/* begin merged-core-js-1.2.6/core.js */
/* begin jQuery-1.2.6/jquery.js */
(function(){var initJQuery=function(){
/*!
 * jQuery 1.2.6 - New Wave Javascript
 *
 * Copyright (c) 2008 John Resig (jquery.com)
 * Dual licensed under the MIT (MIT-LICENSE.txt)
 * and GPL (GPL-LICENSE.txt) licenses.
 * Amazon elects to use jQuery and Sizzle under the MIT license.
 *
 * Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008)
 * Rev: 5685
 */
var jQuery126PatchDelay=13;
var _jQuery=window.jQuery,_$=window.$;
var jQuery=window.jQuery=window.$=function(selector,context){return new jQuery.fn.init(selector,context);
};
var quickExpr=/^[^<]*(<(.|\s)+>)[^>]*$|^#(\w+)$/,isSimple=/^.[^:#\[\.]*$/,undefined;
jQuery.fn=jQuery.prototype={init:function(selector,context){selector=selector||document;
if(selector.nodeType){this[0]=selector;
this.length=1;
return this;
}if(typeof selector=="string"){var match=quickExpr.exec(selector);
if(match&&(match[1]||!context)){if(match[1]){selector=jQuery.clean([match[1]],context);
}else{var elem=document.getElementById(match[3]);
if(elem){if(elem.id!=match[3]){return jQuery().find(selector);
}return jQuery(elem);
}selector=[];
}}else{return jQuery(context).find(selector);
}}else{if(jQuery.isFunction(selector)){return jQuery(document)[jQuery.fn.ready?"ready":"load"](selector);
}}return this.setArray(jQuery.makeArray(selector));
},jquery:"1.2.6",size:function(){return this.length;
},length:0,get:function(num){return num==undefined?jQuery.makeArray(this):this[num];
},pushStack:function(elems){var ret=jQuery(elems);
ret.prevObject=this;
return ret;
},setArray:function(elems){this.length=0;
Array.prototype.push.apply(this,elems);
return this;
},each:function(callback,args){return jQuery.each(this,callback,args);
},index:function(elem){var ret=-1;
return jQuery.inArray(elem&&elem.jquery?elem[0]:elem,this);
},attr:function(name,value,type){var options=name;
if(name.constructor==String){if(value===undefined){return this[0]&&jQuery[type||"attr"](this[0],name);
}else{options={};
options[name]=value;
}}return this.each(function(i){for(name in options){jQuery.attr(type?this.style:this,name,jQuery.prop(this,options[name],type,i,name));
}});
},css:function(key,value){if((key=="width"||key=="height")&&parseFloat(value)<0){value=undefined;
}return this.attr(key,value,"curCSS");
},text:function(text){if(typeof text!="object"&&text!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(text));
}var ret="";
jQuery.each(text||this,function(){jQuery.each(this.childNodes,function(){if(this.nodeType!=8){ret+=this.nodeType!=1?this.nodeValue:jQuery.fn.text([this]);
}});
});
return ret;
},wrapAll:function(html){if(this[0]){jQuery(html,this[0].ownerDocument).clone().insertBefore(this[0]).map(function(){var elem=this;
while(elem.firstChild){elem=elem.firstChild;
}return elem;
}).append(this);
}return this;
},wrapInner:function(html){return this.each(function(){jQuery(this).contents().wrapAll(html);
});
},wrap:function(html){return this.each(function(){jQuery(this).wrapAll(html);
});
},append:function(){return this.domManip(arguments,true,false,function(elem){if(this.nodeType==1){this.appendChild(elem);
}});
},prepend:function(){return this.domManip(arguments,true,true,function(elem){if(this.nodeType==1){this.insertBefore(elem,this.firstChild);
}});
},before:function(){return this.domManip(arguments,false,false,function(elem){this.parentNode.insertBefore(elem,this);
});
},after:function(){return this.domManip(arguments,false,true,function(elem){this.parentNode.insertBefore(elem,this.nextSibling);
});
},end:function(){return this.prevObject||jQuery([]);
},find:function(selector){var elems=jQuery.map(this,function(elem){return jQuery.find(selector,elem);
});
return this.pushStack(/[^+>] [^+>]/.test(selector)||selector.indexOf("..")>-1?jQuery.unique(elems):elems);
},clone:function(events){var ret=this.map(function(){if(jQuery.browser.msie&&!jQuery.isXMLDoc(this)){var clone=this.cloneNode(true),container=document.createElement("div");
container.appendChild(clone);
return jQuery.clean([container.innerHTML])[0];
}else{return this.cloneNode(true);
}});
var clone=ret.find("*").andSelf().each(function(){if(this[expando]!=undefined){this[expando]=null;
}});
if(events===true){this.find("*").andSelf().each(function(i){if(this.nodeType==3){return;
}var events=jQuery.data(this,"events");
for(var type in events){for(var handler in events[type]){jQuery.event.add(clone[i],type,events[type][handler],events[type][handler].data);
}}});
}return ret;
},filter:function(selector){return this.pushStack(jQuery.isFunction(selector)&&jQuery.grep(this,function(elem,i){return selector.call(elem,i);
})||jQuery.multiFilter(selector,this));
},not:function(selector){if(selector.constructor==String){if(isSimple.test(selector)){return this.pushStack(jQuery.multiFilter(selector,this,true));
}else{selector=jQuery.multiFilter(selector,this);
}}var isArrayLike=selector.length&&selector[selector.length-1]!==undefined&&!selector.nodeType;
return this.filter(function(){return isArrayLike?jQuery.inArray(this,selector)<0:this!=selector;
});
},add:function(selector){return this.pushStack(jQuery.unique(jQuery.merge(this.get(),typeof selector=="string"?jQuery(selector):jQuery.makeArray(selector))));
},is:function(selector){return !!selector&&jQuery.multiFilter(selector,this).length>0;
},hasClass:function(selector){return this.is("."+selector);
},val:function(value){if(value==undefined){if(this.length){var elem=this[0];
if(jQuery.nodeName(elem,"select")){var index=elem.selectedIndex,values=[],options=elem.options,one=elem.type=="select-one";
if(index<0){return null;
}for(var i=one?index:0,max=one?index+1:options.length;
i<max;
i++){var option=options[i];
if(option.selected){value=jQuery.browser.msie&&!option.attributes.value.specified?option.text:option.value;
if(one){return value;
}values.push(value);
}}return values;
}else{return(this[0].value||"").replace(/\r/g,"");
}}return undefined;
}if(value.constructor==Number){value+="";
}return this.each(function(){if(this.nodeType!=1){return;
}if(value.constructor==Array&&/radio|checkbox/.test(this.type)){this.checked=(jQuery.inArray(this.value,value)>=0||jQuery.inArray(this.name,value)>=0);
}else{if(jQuery.nodeName(this,"select")){var values=jQuery.makeArray(value);
jQuery("option",this).each(function(){this.selected=(jQuery.inArray(this.value,values)>=0||jQuery.inArray(this.text,values)>=0);
});
if(!values.length){this.selectedIndex=-1;
}}else{this.value=value;
}}});
},html:function(value){return value==undefined?(this[0]?this[0].innerHTML:null):this.empty().append(value);
},replaceWith:function(value){return this.after(value).remove();
},eq:function(i){return this.slice(i,i+1);
},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments));
},map:function(callback){return this.pushStack(jQuery.map(this,function(elem,i){return callback.call(elem,i,elem);
}));
},andSelf:function(){return this.add(this.prevObject);
},data:function(key,value){var parts=key.split(".");
parts[1]=parts[1]?"."+parts[1]:"";
if(value===undefined){var data=this.triggerHandler("getData"+parts[1]+"!",[parts[0]]);
if(data===undefined&&this.length){data=jQuery.data(this[0],key);
}return data===undefined&&parts[1]?this.data(parts[0]):data;
}else{return this.trigger("setData"+parts[1]+"!",[parts[0],value]).each(function(){jQuery.data(this,key,value);
});
}},removeData:function(key){return this.each(function(){jQuery.removeData(this,key);
});
},domManip:function(args,table,reverse,callback){var clone=this.length>1,elems;
return this.each(function(){if(!elems){elems=jQuery.clean(args,this.ownerDocument);
if(reverse){elems.reverse();
}}var obj=this;
if(table&&jQuery.nodeName(this,"table")&&jQuery.nodeName(elems[0],"tr")){obj=this.getElementsByTagName("tbody")[0]||this.appendChild(this.ownerDocument.createElement("tbody"));
}var scripts=jQuery([]);
jQuery.each(elems,function(){var elem=clone?jQuery(this).clone(true)[0]:this;
if(jQuery.nodeName(elem,"script")){scripts=scripts.add(elem);
}else{if(elem.nodeType==1){scripts=scripts.add(jQuery("script",elem).remove());
}callback.call(obj,elem);
}});
scripts.each(evalScript);
});
}};
jQuery.fn.init.prototype=jQuery.fn;
function evalScript(i,elem){if(elem.src){jQuery.ajax({url:elem.src,async:false,dataType:"script"});
}else{jQuery.globalEval(elem.text||elem.textContent||elem.innerHTML||"");
}if(elem.parentNode){elem.parentNode.removeChild(elem);
}}function now(){return +new Date;
}jQuery.extend=jQuery.fn.extend=function(){var target=arguments[0]||{},i=1,length=arguments.length,deep=false,options;
if(target.constructor==Boolean){deep=target;
target=arguments[1]||{};
i=2;
}if(typeof target!="object"&&typeof target!="function"){target={};
}if(length==i){target=this;
--i;
}for(;
i<length;
i++){if((options=arguments[i])!=null){for(var name in options){var src=target[name],copy=options[name];
if(target===copy){continue;
}if(deep&&copy&&typeof copy=="object"&&!copy.nodeType){target[name]=jQuery.extend(deep,src||(copy.length!=null?[]:{}),copy);
}else{if(copy!==undefined){target[name]=copy;
}}}}}return target;
};
var expando="jQuery"+now(),uuid=0,windowData={},exclude=/z-?index|font-?weight|opacity|zoom|line-?height/i,defaultView=document.defaultView||{};
jQuery.extend({noConflict:function(deep){window.$=_$;
if(deep){window.jQuery=_jQuery;
}return jQuery;
},isFunction:function(fn){return !!fn&&typeof fn!="string"&&!fn.nodeName&&fn.constructor!=Array&&/^[\s[]?function/.test(fn+"");
},isXMLDoc:function(elem){return elem.documentElement&&!elem.body||elem.tagName&&elem.ownerDocument&&!elem.ownerDocument.body;
},globalEval:function(data){data=jQuery.trim(data);
if(data){var head=document.getElementsByTagName("head")[0]||document.documentElement,script=document.createElement("script");
script.type="text/javascript";
if(jQuery.browser.msie){script.text=data;
}else{script.appendChild(document.createTextNode(data));
}head.insertBefore(script,head.firstChild);
head.removeChild(script);
}},nodeName:function(elem,name){return elem.nodeName&&elem.nodeName.toUpperCase()==name.toUpperCase();
},cache:{},data:function(elem,name,data){elem=elem==window?windowData:elem;
var id=elem[expando];
if(!id){id=elem[expando]=++uuid;
}if(name&&!jQuery.cache[id]){jQuery.cache[id]={};
}if(data!==undefined){jQuery.cache[id][name]=data;
}return name?jQuery.cache[id][name]:id;
},removeData:function(elem,name){elem=elem==window?windowData:elem;
var id=elem[expando];
if(name){if(jQuery.cache[id]){delete jQuery.cache[id][name];
name="";
for(name in jQuery.cache[id]){break;
}if(!name){jQuery.removeData(elem);
}}}else{try{delete elem[expando];
}catch(e){if(elem.removeAttribute){elem.removeAttribute(expando);
}}delete jQuery.cache[id];
}},each:function(object,callback,args){var name,i=0,length=object.length;
if(args){if(length==undefined){for(name in object){if(callback.apply(object[name],args)===false){break;
}}}else{for(;
i<length;
){if(callback.apply(object[i++],args)===false){break;
}}}}else{if(length==undefined){for(name in object){if(callback.call(object[name],name,object[name])===false){break;
}}}else{for(var value=object[0];
i<length&&callback.call(value,i,value)!==false;
value=object[++i]){}}}return object;
},prop:function(elem,value,type,i,name){if(jQuery.isFunction(value)){value=value.call(elem,i);
}return value&&value.constructor==Number&&type=="curCSS"&&!exclude.test(name)?value+"px":value;
},className:{add:function(elem,classNames){jQuery.each((classNames||"").split(/\s+/),function(i,className){if(elem.nodeType==1&&!jQuery.className.has(elem.className,className)){elem.className+=(elem.className?" ":"")+className;
}});
},remove:function(elem,classNames){if(elem.nodeType==1){elem.className=classNames!=undefined?jQuery.grep(elem.className.split(/\s+/),function(className){return !jQuery.className.has(classNames,className);
}).join(" "):"";
}},has:function(elem,className){return jQuery.inArray(className,(elem.className||elem).toString().split(/\s+/))>-1;
}},swap:function(elem,options,callback){var old={};
for(var name in options){old[name]=elem.style[name];
elem.style[name]=options[name];
}callback.call(elem);
for(var name in options){elem.style[name]=old[name];
}},css:function(elem,name,force){if(name=="width"||name=="height"){var val,props={position:"absolute",visibility:"hidden",display:"block"},which=name=="width"?["Left","Right"]:["Top","Bottom"];
function getWH(){val=name=="width"?elem.offsetWidth:elem.offsetHeight;
var padding=0,border=0;
jQuery.each(which,function(){padding+=parseFloat(jQuery.curCSS(elem,"padding"+this,true))||0;
border+=parseFloat(jQuery.curCSS(elem,"border"+this+"Width",true))||0;
});
val-=Math.round(padding+border);
}if(jQuery(elem).is(":visible")){getWH();
}else{jQuery.swap(elem,props,getWH);
}return Math.max(0,val);
}return jQuery.curCSS(elem,name,force);
},curCSS:function(elem,name,force){var ret,style=elem.style;
function color(elem){if(!jQuery.browser.safari){return false;
}var ret=defaultView.getComputedStyle(elem,null);
return !ret||ret.getPropertyValue("color")=="";
}if(name=="opacity"&&jQuery.browser.msie){ret=jQuery.attr(style,"opacity");
return ret==""?"1":ret;
}if(jQuery.browser.opera&&name=="display"){var save=style.outline;
style.outline="0 solid black";
style.outline=save;
}if(name.match(/float/i)){name=styleFloat;
}if(!force&&style&&style[name]){ret=style[name];
}else{if(defaultView.getComputedStyle){if(name.match(/float/i)){name="float";
}name=name.replace(/([A-Z])/g,"-$1").toLowerCase();
var computedStyle=defaultView.getComputedStyle(elem,null);
if(computedStyle&&!color(elem)){ret=computedStyle.getPropertyValue(name);
}else{var swap=[],stack=[],a=elem,i=0;
for(;
a&&color(a);
a=a.parentNode){stack.unshift(a);
}for(;
i<stack.length;
i++){if(color(stack[i])){swap[i]=stack[i].style.display;
stack[i].style.display="block";
}}ret=name=="display"&&swap[stack.length-1]!=null?"none":(computedStyle&&computedStyle.getPropertyValue(name))||"";
for(i=0;
i<swap.length;
i++){if(swap[i]!=null){stack[i].style.display=swap[i];
}}}if(name=="opacity"&&ret==""){ret="1";
}}else{if(elem.currentStyle){var camelCase=name.replace(/\-(\w)/g,function(all,letter){return letter.toUpperCase();
});
ret=elem.currentStyle[name]||elem.currentStyle[camelCase];
if(!/^\d+(px)?$/i.test(ret)&&/^\d/.test(ret)){var left=style.left,rsLeft=elem.runtimeStyle.left;
elem.runtimeStyle.left=elem.currentStyle.left;
style.left=ret||0;
ret=style.pixelLeft+"px";
style.left=left;
elem.runtimeStyle.left=rsLeft;
}}}}return ret;
},clean:function(elems,context){var ret=[];
context=context||document;
if(typeof context.createElement=="undefined"){context=context.ownerDocument||context[0]&&context[0].ownerDocument||document;
}jQuery.each(elems,function(i,elem){if(!elem){return;
}if(elem.constructor==Number){elem+="";
}if(typeof elem=="string"){elem=elem.replace(/(<(\w+)[^>]*?)\/>/g,function(all,front,tag){return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?all:front+"></"+tag+">";
});
var tags=jQuery.trim(elem).toLowerCase(),div=context.createElement("div");
var wrap=!tags.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!tags.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||tags.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!tags.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!tags.indexOf("<td")||!tags.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!tags.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||jQuery.browser.msie&&[1,"div<div>","</div>"]||[0,"",""];
div.innerHTML=wrap[1]+elem+wrap[2];
while(wrap[0]--){div=div.lastChild;
}if(jQuery.browser.msie){var tbody=!tags.indexOf("<table")&&tags.indexOf("<tbody")<0?div.firstChild&&div.firstChild.childNodes:wrap[1]=="<table>"&&tags.indexOf("<tbody")<0?div.childNodes:[];
for(var j=tbody.length-1;
j>=0;
--j){if(jQuery.nodeName(tbody[j],"tbody")&&!tbody[j].childNodes.length){tbody[j].parentNode.removeChild(tbody[j]);
}}if(/^\s/.test(elem)){div.insertBefore(context.createTextNode(elem.match(/^\s*/)[0]),div.firstChild);
}}elem=jQuery.makeArray(div.childNodes);
}if(elem.length===0&&(!jQuery.nodeName(elem,"form")&&!jQuery.nodeName(elem,"select"))){return;
}if(elem[0]==undefined||jQuery.nodeName(elem,"form")||elem.options){ret.push(elem);
}else{ret=jQuery.merge(ret,elem);
}});
return ret;
},attr:function(elem,name,value){if(!elem||elem.nodeType==3||elem.nodeType==8){return undefined;
}var notxml=!jQuery.isXMLDoc(elem),set=value!==undefined,msie=jQuery.browser.msie;
name=notxml&&jQuery.props[name]||name;
if(elem.tagName){var special=/href|src|style/.test(name);
if(name=="selected"&&jQuery.browser.safari){elem.parentNode.selectedIndex;
}if(name in elem&&notxml&&!special){if(set){if(name=="type"&&jQuery.nodeName(elem,"input")&&elem.parentNode){throw"type property can't be changed";
}elem[name]=value;
}if(jQuery.nodeName(elem,"form")&&elem.getAttributeNode(name)){return elem.getAttributeNode(name).nodeValue;
}return elem[name];
}if(msie&&notxml&&name=="style"){return jQuery.attr(elem.style,"cssText",value);
}if(set){elem.setAttribute(name,""+value);
}var attr=msie&&notxml&&special?elem.getAttribute(name,2):elem.getAttribute(name);
return attr===null?undefined:attr;
}if(msie&&name=="opacity"){if(set){elem.zoom=1;
elem.filter=(elem.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(value)+""=="NaN"?"":"alpha(opacity="+value*100+")");
}return elem.filter&&elem.filter.indexOf("opacity=")>=0?(parseFloat(elem.filter.match(/opacity=([^)]*)/)[1])/100)+"":"";
}name=name.replace(/-([a-z])/ig,function(all,letter){return letter.toUpperCase();
});
if(set){elem[name]=value;
}return elem[name];
},trim:function(text){return(text||"").replace(/^\s+|\s+$/g,"");
},makeArray:function(array){var ret=[];
if(array!=null){var i=array.length;
if(i==null||array.split||array.setInterval||array.call){ret[0]=array;
}else{while(i){ret[--i]=array[i];
}}}return ret;
},inArray:function(elem,array){for(var i=0,length=array.length;
i<length;
i++){if(array[i]===elem){return i;
}}return -1;
},merge:function(first,second){var i=0,elem,pos=first.length;
if(jQuery.browser.msie){while(elem=second[i++]){if(elem.nodeType!=8){first[pos++]=elem;
}}}else{while(elem=second[i++]){first[pos++]=elem;
}}return first;
},unique:function(array){var ret=[],done={};
try{for(var i=0,length=array.length;
i<length;
i++){var id=jQuery.data(array[i]);
if(!done[id]){done[id]=true;
ret.push(array[i]);
}}}catch(e){ret=array;
}return ret;
},grep:function(elems,callback,inv){var ret=[];
for(var i=0,length=elems.length;
i<length;
i++){if(!inv!=!callback(elems[i],i)){ret.push(elems[i]);
}}return ret;
},map:function(elems,callback){var ret=[];
for(var i=0,length=elems.length;
i<length;
i++){var value=callback(elems[i],i);
if(value!=null){ret[ret.length]=value;
}}return ret.concat.apply([],ret);
}});
var userAgent=navigator.userAgent.toLowerCase();
jQuery.browser={version:(userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],safari:/webkit/.test(userAgent),opera:/opera/.test(userAgent),msie:/msie/.test(userAgent)&&!/opera/.test(userAgent),mozilla:/mozilla/.test(userAgent)&&!/(compatible|webkit)/.test(userAgent)};
var styleFloat=jQuery.browser.msie?"styleFloat":"cssFloat";
jQuery.extend({boxModel:!jQuery.browser.msie||document.compatMode=="CSS1Compat",props:{"for":"htmlFor","class":"className","float":styleFloat,cssFloat:styleFloat,styleFloat:styleFloat,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing"}});
jQuery.each({parent:function(elem){return elem.parentNode;
},parents:function(elem){return jQuery.dir(elem,"parentNode");
},next:function(elem){return jQuery.nth(elem,2,"nextSibling");
},prev:function(elem){return jQuery.nth(elem,2,"previousSibling");
},nextAll:function(elem){return jQuery.dir(elem,"nextSibling");
},prevAll:function(elem){return jQuery.dir(elem,"previousSibling");
},siblings:function(elem){return jQuery.sibling(elem.parentNode.firstChild,elem);
},children:function(elem){return jQuery.sibling(elem.firstChild);
},contents:function(elem){return jQuery.nodeName(elem,"iframe")?elem.contentDocument||elem.contentWindow.document:jQuery.makeArray(elem.childNodes);
}},function(name,fn){jQuery.fn[name]=function(selector){var ret=jQuery.map(this,fn);
if(selector&&typeof selector=="string"){ret=jQuery.multiFilter(selector,ret);
}return this.pushStack(jQuery.unique(ret));
};
});
jQuery.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(name,original){jQuery.fn[name]=function(){var args=arguments;
return this.each(function(){for(var i=0,length=args.length;
i<length;
i++){jQuery(args[i])[original](this);
}});
};
});
jQuery.each({removeAttr:function(name){jQuery.attr(this,name,"");
if(this.nodeType==1){this.removeAttribute(name);
}},addClass:function(classNames){jQuery.className.add(this,classNames);
},removeClass:function(classNames){jQuery.className.remove(this,classNames);
},toggleClass:function(classNames){jQuery.className[jQuery.className.has(this,classNames)?"remove":"add"](this,classNames);
},remove:function(selector){if(!selector||jQuery.filter(selector,[this]).r.length){jQuery("*",this).add(this).each(function(){jQuery.event.remove(this);
jQuery.removeData(this);
});
if(this.parentNode){this.parentNode.removeChild(this);
}}},empty:function(){jQuery(">*",this).remove();
while(this.firstChild){this.removeChild(this.firstChild);
}}},function(name,fn){jQuery.fn[name]=function(){return this.each(fn,arguments);
};
});
jQuery.each(["Height","Width"],function(i,name){var type=name.toLowerCase();
jQuery.fn[type]=function(size){return this[0]==window?jQuery.browser.opera&&document.body["client"+name]||jQuery.browser.safari&&window["inner"+name]||document.compatMode=="CSS1Compat"&&document.documentElement["client"+name]||document.body["client"+name]:this[0]==document?Math.max(Math.max(document.body["scroll"+name],document.documentElement["scroll"+name]),Math.max(document.body["offset"+name],document.documentElement["offset"+name])):size==undefined?(this.length?jQuery.css(this[0],type):null):this.css(type,size.constructor==String?size:size+"px");
};
});
function num(elem,prop){return elem[0]&&parseInt(jQuery.curCSS(elem[0],prop,true),10)||0;
}var chars=jQuery.browser.safari&&parseInt(jQuery.browser.version)<417?"(?:[\\w*_-]|\\\\.)":"(?:[\\w\u0128-\uFFFF*_-]|\\\\.)",quickChild=new RegExp("^>\\s*("+chars+"+)"),quickID=new RegExp("^("+chars+"+)(#)("+chars+"+)"),quickClass=new RegExp("^([#.]?)("+chars+"*)");
jQuery.extend({expr:{"":function(a,i,m){return m[2]=="*"||jQuery.nodeName(a,m[2]);
},"#":function(a,i,m){return a.getAttribute("id")==m[2];
},":":{lt:function(a,i,m){return i<m[3]-0;
},gt:function(a,i,m){return i>m[3]-0;
},nth:function(a,i,m){return m[3]-0==i;
},eq:function(a,i,m){return m[3]-0==i;
},first:function(a,i){return i==0;
},last:function(a,i,m,r){return i==r.length-1;
},even:function(a,i){return i%2==0;
},odd:function(a,i){return i%2;
},"first-child":function(a){return a.parentNode.getElementsByTagName("*")[0]==a;
},"last-child":function(a){return jQuery.nth(a.parentNode.lastChild,1,"previousSibling")==a;
},"only-child":function(a){return !jQuery.nth(a.parentNode.lastChild,2,"previousSibling");
},parent:function(a){return a.firstChild;
},empty:function(a){return !a.firstChild;
},contains:function(a,i,m){return(a.textContent||a.innerText||jQuery(a).text()||"").indexOf(m[3])>=0;
},visible:function(a){return"hidden"!=a.type&&jQuery.css(a,"display")!="none"&&jQuery.css(a,"visibility")!="hidden";
},hidden:function(a){return"hidden"==a.type||jQuery.css(a,"display")=="none"||jQuery.css(a,"visibility")=="hidden";
},enabled:function(a){return !a.disabled;
},disabled:function(a){return a.disabled;
},checked:function(a){return a.checked;
},selected:function(a){return a.selected||jQuery.attr(a,"selected");
},text:function(a){return"text"==a.type;
},radio:function(a){return"radio"==a.type;
},checkbox:function(a){return"checkbox"==a.type;
},file:function(a){return"file"==a.type;
},password:function(a){return"password"==a.type;
},submit:function(a){return"submit"==a.type;
},image:function(a){return"image"==a.type;
},reset:function(a){return"reset"==a.type;
},button:function(a){return"button"==a.type||jQuery.nodeName(a,"button");
},input:function(a){return/input|select|textarea|button/i.test(a.nodeName);
},has:function(a,i,m){return jQuery.find(m[3],a).length;
},header:function(a){return/h\d/i.test(a.nodeName);
},animated:function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;
}).length;
}}},parse:[/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?"?)(.*?)\4 *\]/,/^(:)([\w-]+)\("?'?(.*?(\(.*?\))?[^(]*?)"?'?\)/,new RegExp("^([:.#]*)("+chars+"+)")],multiFilter:function(expr,elems,not){var old,cur=[];
while(expr&&expr!=old){old=expr;
var f=jQuery.filter(expr,elems,not);
expr=f.t.replace(/^\s*,\s*/,"");
cur=not?elems=f.r:jQuery.merge(cur,f.r);
}return cur;
},find:function(t,context){if(typeof t!="string"){return[t];
}if(context&&context.nodeType!=1&&context.nodeType!=9){return[];
}context=context||document;
var ret=[context],done=[],last,nodeName;
while(t&&last!=t){var r=[];
last=t;
t=jQuery.trim(t);
var foundToken=false,re=quickChild,m=re.exec(t);
if(m){nodeName=m[1].toUpperCase();
for(var i=0;
ret[i];
i++){for(var c=ret[i].firstChild;
c;
c=c.nextSibling){if(c.nodeType==1&&(nodeName=="*"||c.nodeName.toUpperCase()==nodeName)){r.push(c);
}}}ret=r;
t=t.replace(re,"");
if(t.indexOf(" ")==0){continue;
}foundToken=true;
}else{re=/^([>+~])\s*(\w*)/i;
if((m=re.exec(t))!=null){r=[];
var merge={};
nodeName=m[2].toUpperCase();
m=m[1];
for(var j=0,rl=ret.length;
j<rl;
j++){var n=m=="~"||m=="+"?ret[j].nextSibling:ret[j].firstChild;
for(;
n;
n=n.nextSibling){if(n.nodeType==1){var id=jQuery.data(n);
if(m=="~"&&merge[id]){break;
}if(!nodeName||n.nodeName.toUpperCase()==nodeName){if(m=="~"){merge[id]=true;
}r.push(n);
}if(m=="+"){break;
}}}}ret=r;
t=jQuery.trim(t.replace(re,""));
foundToken=true;
}}if(t&&!foundToken){if(!t.indexOf(",")){if(context==ret[0]){ret.shift();
}done=jQuery.merge(done,ret);
r=ret=[context];
t=" "+t.substr(1,t.length);
}else{var re2=quickID;
var m=re2.exec(t);
if(m){m=[0,m[2],m[3],m[1]];
}else{re2=quickClass;
m=re2.exec(t);
}m[2]=m[2].replace(/\\/g,"");
var elem=ret[ret.length-1];
if(m[1]=="#"&&elem&&elem.getElementById&&!jQuery.isXMLDoc(elem)){var oid=elem.getElementById(m[2]);
if((jQuery.browser.msie||jQuery.browser.opera)&&oid&&typeof oid.id=="string"&&oid.id!=m[2]){oid=jQuery('[@id="'+m[2]+'"]',elem)[0];
}ret=r=oid&&(!m[3]||jQuery.nodeName(oid,m[3]))?[oid]:[];
}else{for(var i=0;
ret[i];
i++){var tag=m[1]=="#"&&m[3]?m[3]:m[1]!=""||m[0]==""?"*":m[2];
if(tag=="*"&&ret[i].nodeName.toLowerCase()=="object"){tag="param";
}r=jQuery.merge(r,ret[i].getElementsByTagName(tag));
}if(m[1]=="."){r=jQuery.classFilter(r,m[2]);
}if(m[1]=="#"){var tmp=[];
for(var i=0;
r[i];
i++){if(r[i].getAttribute("id")==m[2]){tmp=[r[i]];
break;
}}r=tmp;
}ret=r;
}t=t.replace(re2,"");
}}if(t){var val=jQuery.filter(t,r);
ret=r=val.r;
t=jQuery.trim(val.t);
}}if(t){ret=[];
}if(ret&&context==ret[0]){ret.shift();
}done=jQuery.merge(done,ret);
return done;
},classFilter:function(r,m,not){m=" "+m+" ";
var tmp=[];
for(var i=0;
r[i];
i++){var pass=(" "+r[i].className+" ").indexOf(m)>=0;
if(!not&&pass||not&&!pass){tmp.push(r[i]);
}}return tmp;
},filter:function(t,r,not){var last;
while(t&&t!=last){last=t;
var p=jQuery.parse,m;
for(var i=0;
p[i];
i++){m=p[i].exec(t);
if(m){t=t.substring(m[0].length);
m[2]=m[2].replace(/\\/g,"");
break;
}}if(!m){break;
}if(m[1]==":"&&m[2]=="not"){r=isSimple.test(m[3])?jQuery.filter(m[3],r,true).r:jQuery(r).not(m[3]);
}else{if(m[1]=="."){r=jQuery.classFilter(r,m[2],not);
}else{if(m[1]=="["){var tmp=[],type=m[3];
for(var i=0,rl=r.length;
i<rl;
i++){var a=r[i],z=a[jQuery.props[m[2]]||m[2]];
if(z==null||/href|src|selected/.test(m[2])){z=jQuery.attr(a,m[2])||"";
}if((type==""&&!!z||type=="="&&z==m[5]||type=="!="&&z!=m[5]||type=="^="&&z&&!z.indexOf(m[5])||type=="$="&&z.substr(z.length-m[5].length)==m[5]||(type=="*="||type=="~=")&&z.indexOf(m[5])>=0)^not){tmp.push(a);
}}r=tmp;
}else{if(m[1]==":"&&m[2]=="nth-child"){var merge={},tmp=[],test=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(m[3]=="even"&&"2n"||m[3]=="odd"&&"2n+1"||!/\D/.test(m[3])&&"0n+"+m[3]||m[3]),first=(test[1]+(test[2]||1))-0,last=test[3]-0;
for(var i=0,rl=r.length;
i<rl;
i++){var node=r[i],parentNode=node.parentNode,id=jQuery.data(parentNode);
if(!merge[id]){var c=1;
for(var n=parentNode.firstChild;
n;
n=n.nextSibling){if(n.nodeType==1){n.nodeIndex=c++;
}}merge[id]=true;
}var add=false;
if(first==0){if(node.nodeIndex==last){add=true;
}}else{if((node.nodeIndex-last)%first==0&&(node.nodeIndex-last)/first>=0){add=true;
}}if(add^not){tmp.push(node);
}}r=tmp;
}else{var fn=jQuery.expr[m[1]];
if(typeof fn=="object"){fn=fn[m[2]];
}if(typeof fn=="string"){fn=eval("false||function(a,i){return "+fn+";}");
}r=jQuery.grep(r,function(elem,i){return fn(elem,i,m,r);
},not);
}}}}}return{r:r,t:t};
},dir:function(elem,dir){var matched=[],cur=elem[dir];
while(cur&&cur!=document){if(cur.nodeType==1){matched.push(cur);
}cur=cur[dir];
}return matched;
},nth:function(cur,result,dir,elem){result=result||1;
var num=0;
for(;
cur;
cur=cur[dir]){if(cur.nodeType==1&&++num==result){break;
}}return cur;
},sibling:function(n,elem){var r=[];
for(;
n;
n=n.nextSibling){if(n.nodeType==1&&n!=elem){r.push(n);
}}return r;
}});
jQuery.event={add:function(elem,types,handler,data){if(elem.nodeType==3||elem.nodeType==8){return;
}if(jQuery.browser.msie&&elem.setInterval){elem=window;
}if(!handler.guid){handler.guid=this.guid++;
}if(data!=undefined){var fn=handler;
handler=this.proxy(fn,function(){return fn.apply(this,arguments);
});
handler.data=data;
}var events=jQuery.data(elem,"events")||jQuery.data(elem,"events",{}),handle=jQuery.data(elem,"handle")||jQuery.data(elem,"handle",function(){if(typeof jQuery!="undefined"&&!jQuery.event.triggered){return jQuery.event.handle.apply(arguments.callee.elem,arguments);
}});
handle.elem=elem;
jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");
type=parts[0];
handler.type=parts[1];
var handlers=events[type];
if(!handlers){handlers=events[type]={};
if(!jQuery.event.special[type]||jQuery.event.special[type].setup.call(elem)===false){if(elem.addEventListener){elem.addEventListener(type,handle,false);
}else{if(elem.attachEvent){elem.attachEvent("on"+type,handle);
}}}}handlers[handler.guid]=handler;
jQuery.event.global[type]=true;
});
elem=null;
},guid:1,global:{},remove:function(elem,types,handler){if(elem.nodeType==3||elem.nodeType==8){return;
}var events=jQuery.data(elem,"events"),ret,index;
if(events){if(types==undefined||(typeof types=="string"&&types.charAt(0)==".")){for(var type in events){this.remove(elem,type+(types||""));
}}else{if(types.type){handler=types.handler;
types=types.type;
}jQuery.each(types.split(/\s+/),function(index,type){var parts=type.split(".");
type=parts[0];
if(events[type]){if(handler){delete events[type][handler.guid];
}else{for(handler in events[type]){if(!parts[1]||events[type][handler].type==parts[1]){delete events[type][handler];
}}}for(ret in events[type]){break;
}if(!ret){if(!jQuery.event.special[type]||jQuery.event.special[type].teardown.call(elem)===false){if(elem.removeEventListener){elem.removeEventListener(type,jQuery.data(elem,"handle"),false);
}else{if(elem.detachEvent){elem.detachEvent("on"+type,jQuery.data(elem,"handle"));
}}}ret=null;
delete events[type];
}}});
}for(ret in events){break;
}if(!ret){var handle=jQuery.data(elem,"handle");
if(handle){handle.elem=null;
}jQuery.removeData(elem,"events");
jQuery.removeData(elem,"handle");
}}},trigger:function(type,data,elem,donative,extra){data=jQuery.makeArray(data);
if(type.indexOf("!")>=0){type=type.slice(0,-1);
var exclusive=true;
}if(!elem){if(this.global[type]){jQuery("*").add([window,document]).trigger(type,data);
}}else{if(elem.nodeType==3||elem.nodeType==8){return undefined;
}var val,ret,fn=jQuery.isFunction(elem[type]||null),event=!data[0]||!data[0].preventDefault;
if(event){data.unshift({type:type,target:elem,preventDefault:function(){},stopPropagation:function(){},timeStamp:now()});
data[0][expando]=true;
}data[0].type=type;
if(exclusive){data[0].exclusive=true;
}var handle=jQuery.data(elem,"handle");
if(handle){val=handle.apply(elem,data);
}if((!fn||(jQuery.nodeName(elem,"a")&&type=="click"))&&elem["on"+type]&&elem["on"+type].apply(elem,data)===false){val=false;
}if(event){data.shift();
}if(extra&&jQuery.isFunction(extra)){ret=extra.apply(elem,val==null?data:data.concat(val));
if(ret!==undefined){val=ret;
}}if(fn&&donative!==false&&val!==false&&!(jQuery.nodeName(elem,"a")&&type=="click")){this.triggered=true;
try{elem[type]();
}catch(e){}}this.triggered=false;
}return val;
},handle:function(event){var val,ret,namespace,all,handlers;
event=arguments[0]=jQuery.event.fix(event||window.event);
namespace=event.type.split(".");
event.type=namespace[0];
namespace=namespace[1];
all=!namespace&&!event.exclusive;
handlers=(jQuery.data(this,"events")||{})[event.type];
for(var j in handlers){var handler=handlers[j];
if(all||handler.type==namespace){event.handler=handler;
event.data=handler.data;
ret=handler.apply(this,arguments);
if(val!==false){val=ret;
}if(ret===false){event.preventDefault();
event.stopPropagation();
}}}return val;
},fix:function(event){if(event[expando]==true){return event;
}var originalEvent=event;
event={originalEvent:originalEvent};
var props="altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which".split(" ");
for(var i=props.length;
i;
i--){event[props[i]]=originalEvent[props[i]];
}event[expando]=true;
event.preventDefault=function(){if(originalEvent.preventDefault){originalEvent.preventDefault();
}originalEvent.returnValue=false;
};
event.stopPropagation=function(){if(originalEvent.stopPropagation){originalEvent.stopPropagation();
}originalEvent.cancelBubble=true;
};
event.timeStamp=event.timeStamp||now();
if(!event.target){event.target=event.srcElement||document;
}if(event.target.nodeType==3){event.target=event.target.parentNode;
}if(!event.relatedTarget&&event.fromElement){event.relatedTarget=event.fromElement==event.target?event.toElement:event.fromElement;
}if(event.pageX==null&&event.clientX!=null){var doc=document.documentElement,body=document.body;
event.pageX=event.clientX+(doc&&doc.scrollLeft||body&&body.scrollLeft||0)-(doc.clientLeft||0);
event.pageY=event.clientY+(doc&&doc.scrollTop||body&&body.scrollTop||0)-(doc.clientTop||0);
}if(!event.which&&((event.charCode||event.charCode===0)?event.charCode:event.keyCode)){event.which=event.charCode||event.keyCode;
}if(!event.metaKey&&event.ctrlKey){event.metaKey=event.ctrlKey;
}if(!event.which&&event.button){event.which=(event.button&1?1:(event.button&2?3:(event.button&4?2:0)));
}return event;
},proxy:function(fn,proxy){proxy.guid=fn.guid=fn.guid||proxy.guid||this.guid++;
return proxy;
},special:{ready:{setup:function(){bindReady();
return;
},teardown:function(){return;
}},mouseenter:{setup:function(){if(jQuery.browser.msie){return false;
}jQuery(this).bind("mouseover",jQuery.event.special.mouseenter.handler);
return true;
},teardown:function(){if(jQuery.browser.msie){return false;
}jQuery(this).unbind("mouseover",jQuery.event.special.mouseenter.handler);
return true;
},handler:function(event){if(withinElement(event,this)){return true;
}event.type="mouseenter";
return jQuery.event.handle.apply(this,arguments);
}},mouseleave:{setup:function(){if(jQuery.browser.msie){return false;
}jQuery(this).bind("mouseout",jQuery.event.special.mouseleave.handler);
return true;
},teardown:function(){if(jQuery.browser.msie){return false;
}jQuery(this).unbind("mouseout",jQuery.event.special.mouseleave.handler);
return true;
},handler:function(event){if(withinElement(event,this)){return true;
}event.type="mouseleave";
return jQuery.event.handle.apply(this,arguments);
}}}};
jQuery.fn.extend({bind:function(type,data,fn){return type=="unload"?this.one(type,data,fn):this.each(function(){jQuery.event.add(this,type,fn||data,fn&&data);
});
},one:function(type,data,fn){var one=jQuery.event.proxy(fn||data,function(event){jQuery(this).unbind(event,one);
return(fn||data).apply(this,arguments);
});
return this.each(function(){jQuery.event.add(this,type,one,fn&&data);
});
},unbind:function(type,fn){return this.each(function(){jQuery.event.remove(this,type,fn);
});
},trigger:function(type,data,fn){return this.each(function(){jQuery.event.trigger(type,data,this,true,fn);
});
},triggerHandler:function(type,data,fn){return this[0]&&jQuery.event.trigger(type,data,this[0],false,fn);
},toggle:function(fn){var args=arguments,i=1;
while(i<args.length){jQuery.event.proxy(fn,args[i++]);
}return this.click(jQuery.event.proxy(fn,function(event){this.lastToggle=(this.lastToggle||0)%i;
event.preventDefault();
return args[this.lastToggle++].apply(this,arguments)||false;
}));
},hover:function(fnOver,fnOut){return this.bind("mouseenter",fnOver).bind("mouseleave",fnOut);
},ready:function(fn){bindReady();
if(jQuery.isReady){fn.call(document,jQuery);
}else{jQuery.readyList.push(function(){return fn.call(this,jQuery);
});
}return this;
}});
jQuery.extend({isReady:false,readyList:[],ready:function(){if(!jQuery.isReady){jQuery.isReady=true;
if(jQuery.readyList){jQuery.each(jQuery.readyList,function(){this.call(document);
});
jQuery.readyList=null;
}jQuery(document).triggerHandler("ready");
}}});
var readyBound=false;
function bindReady(){if(readyBound){return;
}readyBound=true;
if(document.addEventListener&&!jQuery.browser.opera){document.addEventListener("DOMContentLoaded",jQuery.ready,false);
}if(jQuery.browser.msie&&window==top){(function(){if(jQuery.isReady){return;
}try{document.documentElement.doScroll("left");
}catch(error){setTimeout(arguments.callee,jQuery126PatchDelay);
return;
}jQuery.ready();
})();
}if(jQuery.browser.opera){document.addEventListener("DOMContentLoaded",function(){if(jQuery.isReady){return;
}for(var i=0;
i<document.styleSheets.length;
i++){if(document.styleSheets[i].disabled){setTimeout(arguments.callee,jQuery126PatchDelay);
return;
}}jQuery.ready();
},false);
}if(jQuery.browser.safari){var numStyles;
(function(){if(jQuery.isReady){return;
}if(document.readyState!="loaded"&&document.readyState!="complete"){setTimeout(arguments.callee,jQuery126PatchDelay);
return;
}if(numStyles===undefined){numStyles=jQuery("style, link[rel=stylesheet]").length;
}if(document.styleSheets.length!=numStyles){setTimeout(arguments.callee,jQuery126PatchDelay);
return;
}jQuery.ready();
})();
}jQuery.event.add(window,"load",jQuery.ready);
}jQuery.each(("blur,focus,load,resize,scroll,unload,click,dblclick,"+"mousedown,mouseup,mousemove,mouseover,mouseout,change,select,"+"submit,keydown,keypress,keyup,error").split(","),function(i,name){jQuery.fn[name]=function(fn){return fn?this.bind(name,fn):this.trigger(name);
};
});
var withinElement=function(event,elem){var parent=event.relatedTarget;
while(parent&&parent!=elem){try{parent=parent.parentNode;
}catch(error){parent=elem;
}}return parent==elem;
};
jQuery(window).bind("unload",function(){jQuery("*").add(document).unbind();
});
jQuery.fn.extend({_load:jQuery.fn.load,load:function(url,params,callback){if(typeof url!="string"){return this._load(url);
}var off=url.indexOf(" ");
if(off>=0){var selector=url.slice(off,url.length);
url=url.slice(0,off);
}callback=callback||function(){};
var type="GET";
if(params){if(jQuery.isFunction(params)){callback=params;
params=null;
}else{params=jQuery.param(params);
type="POST";
}}var self=this;
jQuery.ajax({url:url,type:type,dataType:"html",data:params,complete:function(res,status){if(status=="success"||status=="notmodified"){self.html(selector?jQuery("<div/>").append(res.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(selector):res.responseText);
}self.each(callback,[res.responseText,status,res]);
}});
return this;
},serialize:function(){return jQuery.param(this.serializeArray());
},serializeArray:function(){return this.map(function(){return jQuery.nodeName(this,"form")?jQuery.makeArray(this.elements):this;
}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password/i.test(this.type));
}).map(function(i,elem){var val=jQuery(this).val();
return val==null?null:val.constructor==Array?jQuery.map(val,function(val,i){return{name:elem.name,value:val};
}):{name:elem.name,value:val};
}).get();
}});
jQuery.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(i,o){jQuery.fn[o]=function(f){return this.bind(o,f);
};
});
var jsc=now();
jQuery.extend({get:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
data=null;
}return jQuery.ajax({type:"GET",url:url,data:data,success:callback,dataType:type});
},getScript:function(url,callback){return jQuery.get(url,null,callback,"script");
},getJSON:function(url,data,callback){return jQuery.get(url,data,callback,"json");
},post:function(url,data,callback,type){if(jQuery.isFunction(data)){callback=data;
data={};
}return jQuery.ajax({type:"POST",url:url,data:data,success:callback,dataType:type});
},ajaxSetup:function(settings){jQuery.extend(jQuery.ajaxSettings,settings);
},ajaxSettings:{url:location.href,global:true,type:"GET",timeout:0,contentType:"application/x-www-form-urlencoded",processData:true,async:true,data:null,username:null,password:null,accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(s){s=jQuery.extend(true,s,jQuery.extend(true,{},jQuery.ajaxSettings,s));
var jsonp,jsre=/=\?(&|$)/g,status,data,type=s.type.toUpperCase();
if(s.data&&s.processData&&typeof s.data!="string"){s.data=jQuery.param(s.data);
}if(s.dataType=="jsonp"){if(type=="GET"){if(!s.url.match(jsre)){s.url+=(s.url.match(/\?/)?"&":"?")+(s.jsonp||"callback")+"=?";
}}else{if(!s.data||!s.data.match(jsre)){s.data=(s.data?s.data+"&":"")+(s.jsonp||"callback")+"=?";
}}s.dataType="json";
}if(s.dataType=="json"&&(s.data&&s.data.match(jsre)||s.url.match(jsre))){jsonp="jsonp"+jsc++;
if(s.data){s.data=(s.data+"").replace(jsre,"="+jsonp+"$1");
}s.url=s.url.replace(jsre,"="+jsonp+"$1");
s.dataType="script";
window[jsonp]=function(tmp){data=tmp;
success();
complete();
window[jsonp]=undefined;
try{delete window[jsonp];
}catch(e){}if(head){head.removeChild(script);
}};
}if(s.dataType=="script"&&s.cache==null){s.cache=false;
}if(s.cache===false&&type=="GET"){var ts=now();
var ret=s.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+ts+"$2");
s.url=ret+((ret==s.url)?(s.url.match(/\?/)?"&":"?")+"_="+ts:"");
}if(s.data&&type=="GET"){s.url+=(s.url.match(/\?/)?"&":"?")+s.data;
s.data=null;
}if(s.global&&!jQuery.active++){jQuery.event.trigger("ajaxStart");
}var remote=/^(?:\w+:)?\/\/([^\/?#]+)/;
if(s.dataType=="script"&&type=="GET"&&remote.test(s.url)&&remote.exec(s.url)[1]!=location.host){var head=document.getElementsByTagName("head")[0];
var script=document.createElement("script");
script.src=s.url;
if(s.scriptCharset){script.charset=s.scriptCharset;
}if(!jsonp){var done=false;
script.onload=script.onreadystatechange=function(){if(!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){done=true;
success();
complete();
head.removeChild(script);
}};
}head.appendChild(script);
return undefined;
}var requestDone=false;
var xhr=window.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
if(s.username){xhr.open(type,s.url,s.async,s.username,s.password);
}else{xhr.open(type,s.url,s.async);
}try{if(s.data){xhr.setRequestHeader("Content-Type",s.contentType);
}if(s.ifModified){xhr.setRequestHeader("If-Modified-Since",jQuery.lastModified[s.url]||"Thu, 01 Jan 1970 00:00:00 GMT");
}xhr.setRequestHeader("X-Requested-With","XMLHttpRequest");
xhr.setRequestHeader("Accept",s.dataType&&s.accepts[s.dataType]?s.accepts[s.dataType]+", */*":s.accepts._default);
}catch(e){}if(s.beforeSend&&s.beforeSend(xhr,s)===false){s.global&&jQuery.active--;
xhr.abort();
return false;
}if(s.global){jQuery.event.trigger("ajaxSend",[xhr,s]);
}var onreadystatechange=function(isTimeout){if(!requestDone&&xhr&&(xhr.readyState==4||isTimeout=="timeout")){requestDone=true;
if(ival){clearInterval(ival);
ival=null;
}status=isTimeout=="timeout"&&"timeout"||!jQuery.httpSuccess(xhr)&&"error"||s.ifModified&&jQuery.httpNotModified(xhr,s.url)&&"notmodified"||"success";
if(status=="success"){try{data=jQuery.httpData(xhr,s.dataType,s.dataFilter);
}catch(e){status="parsererror";
}}if(status=="success"){var modRes;
try{modRes=xhr.getResponseHeader("Last-Modified");
}catch(e){}if(s.ifModified&&modRes){jQuery.lastModified[s.url]=modRes;
}if(!jsonp){success();
}}else{jQuery.handleError(s,xhr,status);
}complete();
if(s.async){xhr=null;
}}};
if(s.async){var ival=setInterval(onreadystatechange,13);
if(s.timeout>0){setTimeout(function(){if(xhr){xhr.abort();
if(!requestDone){onreadystatechange("timeout");
}}},s.timeout);
}}try{xhr.send(s.data);
}catch(e){jQuery.handleError(s,xhr,null,e);
}if(!s.async){onreadystatechange();
}function success(){if(s.success){s.success(data,status);
}if(s.global){jQuery.event.trigger("ajaxSuccess",[xhr,s]);
}}function complete(){if(s.complete){s.complete(xhr,status);
}if(s.global){jQuery.event.trigger("ajaxComplete",[xhr,s]);
}if(s.global&&!--jQuery.active){jQuery.event.trigger("ajaxStop");
}}return xhr;
},handleError:function(s,xhr,status,e){if(s.error){s.error(xhr,status,e);
}if(s.global){jQuery.event.trigger("ajaxError",[xhr,s,e]);
}},active:0,httpSuccess:function(xhr){try{return !xhr.status&&location.protocol=="file:"||(xhr.status>=200&&xhr.status<300)||xhr.status==304||xhr.status==1223||jQuery.browser.safari&&xhr.status==undefined;
}catch(e){}return false;
},httpNotModified:function(xhr,url){try{var xhrRes=xhr.getResponseHeader("Last-Modified");
return xhr.status==304||xhrRes==jQuery.lastModified[url]||jQuery.browser.safari&&xhr.status==undefined;
}catch(e){}return false;
},httpData:function(xhr,type,filter){var ct=xhr.getResponseHeader("content-type"),xml=type=="xml"||!type&&ct&&ct.indexOf("xml")>=0,data=xml?xhr.responseXML:xhr.responseText;
if(xml&&data.documentElement.tagName=="parsererror"){throw"parsererror";
}if(filter){data=filter(data,type);
}if(type=="script"){jQuery.globalEval(data);
}if(type=="json"){data=eval("("+data+")");
}return data;
},param:function(a){var s=[];
if(a.constructor==Array||a.jquery){jQuery.each(a,function(){s.push(encodeURIComponent(this.name)+"="+encodeURIComponent(this.value));
});
}else{for(var j in a){if(a[j]&&a[j].constructor==Array){jQuery.each(a[j],function(){s.push(encodeURIComponent(j)+"="+encodeURIComponent(this));
});
}else{s.push(encodeURIComponent(j)+"="+encodeURIComponent(jQuery.isFunction(a[j])?a[j]():a[j]));
}}}return s.join("&").replace(/%20/g,"+");
}});
jQuery.fn.extend({show:function(speed,callback){return speed?this.animate({height:"show",width:"show",opacity:"show"},speed,callback):this.filter(":hidden").each(function(){this.style.display=this.oldblock||"";
if(jQuery.css(this,"display")=="none"){var elem=jQuery("<"+this.tagName+" />").appendTo("body");
this.style.display=elem.css("display");
if(this.style.display=="none"){this.style.display="block";
}elem.remove();
}}).end();
},hide:function(speed,callback){return speed?this.animate({height:"hide",width:"hide",opacity:"hide"},speed,callback):this.filter(":visible").each(function(){this.oldblock=this.oldblock||jQuery.css(this,"display");
this.style.display="none";
}).end();
},_toggle:jQuery.fn.toggle,toggle:function(fn,fn2){return jQuery.isFunction(fn)&&jQuery.isFunction(fn2)?this._toggle.apply(this,arguments):fn?this.animate({height:"toggle",width:"toggle",opacity:"toggle"},fn,fn2):this.each(function(){jQuery(this)[jQuery(this).is(":hidden")?"show":"hide"]();
});
},slideDown:function(speed,callback){return this.animate({height:"show"},speed,callback);
},slideUp:function(speed,callback){return this.animate({height:"hide"},speed,callback);
},slideToggle:function(speed,callback){return this.animate({height:"toggle"},speed,callback);
},fadeIn:function(speed,callback){return this.animate({opacity:"show"},speed,callback);
},fadeOut:function(speed,callback){return this.animate({opacity:"hide"},speed,callback);
},fadeTo:function(speed,to,callback){return this.animate({opacity:to},speed,callback);
},animate:function(prop,speed,easing,callback){var optall=jQuery.speed(speed,easing,callback);
return this[optall.queue===false?"each":"queue"](function(){if(this.nodeType!=1){return false;
}var opt=jQuery.extend({},optall),p,hidden=jQuery(this).is(":hidden"),self=this;
for(p in prop){if(prop[p]=="hide"&&hidden||prop[p]=="show"&&!hidden){return opt.complete.call(this);
}if(p=="height"||p=="width"){opt.display=jQuery.css(this,"display");
opt.overflow=this.style.overflow;
}}if(opt.overflow!=null){this.style.overflow="hidden";
}opt.curAnim=jQuery.extend({},prop);
jQuery.each(prop,function(name,val){var e=new jQuery.fx(self,opt,name);
if(/toggle|show|hide/.test(val)){e[val=="toggle"?hidden?"show":"hide":val](prop);
}else{var parts=val.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),start=e.cur(true)||0;
if(parts){var end=parseFloat(parts[2]),unit=parts[3]||"px";
if(unit!="px"){self.style[name]=(end||1)+unit;
start=((end||1)/e.cur(true))*start;
self.style[name]=start+unit;
}if(parts[1]){end=((parts[1]=="-="?-1:1)*end)+start;
}e.custom(start,end,unit);
}else{e.custom(start,val,"");
}}});
return true;
});
},queue:function(type,fn){if(jQuery.isFunction(type)||(type&&type.constructor==Array)){fn=type;
type="fx";
}if(!type||(typeof type=="string"&&!fn)){return queue(this[0],type);
}return this.each(function(){if(fn.constructor==Array){queue(this,type,fn);
}else{queue(this,type).push(fn);
if(queue(this,type).length==1){fn.call(this);
}}});
},stop:function(clearQueue,gotoEnd){var timers=jQuery.timers;
if(clearQueue){this.queue([]);
}this.each(function(){for(var i=timers.length-1;
i>=0;
i--){if(timers[i].elem==this){if(gotoEnd){timers[i](true);
}timers.splice(i,1);
}}});
if(!gotoEnd){this.dequeue();
}return this;
}});
var queue=function(elem,type,array){if(elem){type=type||"fx";
var q=jQuery.data(elem,type+"queue");
if(!q||array){q=jQuery.data(elem,type+"queue",jQuery.makeArray(array));
}}return q;
};
jQuery.fn.dequeue=function(type){type=type||"fx";
return this.each(function(){var q=queue(this,type);
q.shift();
if(q.length){q[0].call(this);
}});
};
jQuery.extend({speed:function(speed,easing,fn){var opt=speed&&speed.constructor==Object?speed:{complete:fn||!fn&&easing||jQuery.isFunction(speed)&&speed,duration:speed,easing:fn&&easing||easing&&easing.constructor!=Function&&easing};
opt.duration=(opt.duration&&opt.duration.constructor==Number?opt.duration:jQuery.fx.speeds[opt.duration])||jQuery.fx.speeds.def;
opt.old=opt.complete;
opt.complete=function(){if(opt.queue!==false){jQuery(this).dequeue();
}if(jQuery.isFunction(opt.old)){opt.old.call(this);
}};
return opt;
},easing:{linear:function(p,n,firstNum,diff){return firstNum+diff*p;
},swing:function(p,n,firstNum,diff){return((-Math.cos(p*Math.PI)/2)+0.5)*diff+firstNum;
}},timers:[],timerId:null,fx:function(elem,options,prop){this.options=options;
this.elem=elem;
this.prop=prop;
if(!options.orig){options.orig={};
}}});
jQuery.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this);
}(jQuery.fx.step[this.prop]||jQuery.fx.step._default)(this);
if(this.prop=="height"||this.prop=="width"){this.elem.style.display="block";
}},cur:function(force){if(this.elem[this.prop]!=null&&this.elem.style[this.prop]==null){return this.elem[this.prop];
}var r=parseFloat(jQuery.css(this.elem,this.prop,force));
return r&&r>-10000?r:parseFloat(jQuery.curCSS(this.elem,this.prop))||0;
},custom:function(from,to,unit){this.startTime=now();
this.start=from;
this.end=to;
this.unit=unit||this.unit||"px";
this.now=this.start;
this.pos=this.state=0;
this.update();
var self=this;
function t(gotoEnd){return self.step(gotoEnd);
}t.elem=this.elem;
jQuery.timers.push(t);
if(jQuery.timerId==null){jQuery.timerId=setInterval(function(){var timers=jQuery.timers;
for(var i=0;
i<timers.length;
i++){if(!timers[i]()){timers.splice(i--,1);
}}if(!timers.length){clearInterval(jQuery.timerId);
jQuery.timerId=null;
}},13);
}},show:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
this.options.show=true;
this.custom(0,this.cur());
if(this.prop=="width"||this.prop=="height"){this.elem.style[this.prop]="1px";
}jQuery(this.elem).show();
},hide:function(){this.options.orig[this.prop]=jQuery.attr(this.elem.style,this.prop);
this.options.hide=true;
this.custom(this.cur(),0);
},step:function(gotoEnd){var t=now();
if(gotoEnd||t>this.options.duration+this.startTime){this.now=this.end;
this.pos=this.state=1;
this.update();
this.options.curAnim[this.prop]=true;
var done=true;
for(var i in this.options.curAnim){if(this.options.curAnim[i]!==true){done=false;
}}if(done){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;
this.elem.style.display=this.options.display;
if(jQuery.css(this.elem,"display")=="none"){this.elem.style.display="block";
}}if(this.options.hide){this.elem.style.display="none";
}if(this.options.hide||this.options.show){for(var p in this.options.curAnim){jQuery.attr(this.elem.style,p,this.options.orig[p]);
}}}if(done){this.options.complete.call(this.elem);
}return false;
}else{var n=t-this.startTime;
this.state=n/this.options.duration;
this.pos=jQuery.easing[this.options.easing||(jQuery.easing.swing?"swing":"linear")](this.state,n,0,1,this.options.duration);
this.now=this.start+((this.end-this.start)*this.pos);
this.update();
}return true;
}};
jQuery.extend(jQuery.fx,{speeds:{slow:600,fast:200,def:400},step:{scrollLeft:function(fx){fx.elem.scrollLeft=fx.now;
},scrollTop:function(fx){fx.elem.scrollTop=fx.now;
},opacity:function(fx){jQuery.attr(fx.elem.style,"opacity",fx.now);
},_default:function(fx){fx.elem.style[fx.prop]=fx.now+fx.unit;
}}});
jQuery.fn.offset=function(){var left=0,top=0,elem=this[0],results;
if(elem){with(jQuery.browser){var parent=elem.parentNode,offsetChild=elem,offsetParent=elem.offsetParent,doc=elem.ownerDocument,safari2=safari&&parseInt(version)<522&&!/adobeair/i.test(userAgent),css=jQuery.curCSS,fixed=css(elem,"position")=="fixed";
if(elem.getBoundingClientRect){var box=elem.getBoundingClientRect();
add(box.left+Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),box.top+Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
add(-doc.documentElement.clientLeft,-doc.documentElement.clientTop);
}else{add(elem.offsetLeft,elem.offsetTop);
while(offsetParent){add(offsetParent.offsetLeft,offsetParent.offsetTop);
if(mozilla&&!/^t(able|d|h)$/i.test(offsetParent.tagName)||safari&&!safari2){border(offsetParent);
}if(!fixed&&css(offsetParent,"position")=="fixed"){fixed=true;
}offsetChild=/^body$/i.test(offsetParent.tagName)?offsetChild:offsetParent;
offsetParent=offsetParent.offsetParent;
}while(parent&&parent.tagName&&!/^body|html$/i.test(parent.tagName)){if(!/^inline|table.*$/i.test(css(parent,"display"))){add(-parent.scrollLeft,-parent.scrollTop);
}if(mozilla&&css(parent,"overflow")!="visible"){border(parent);
}parent=parent.parentNode;
}if((safari2&&(fixed||css(offsetChild,"position")=="absolute"))||(mozilla&&css(offsetChild,"position")!="absolute")){add(-doc.body.offsetLeft,-doc.body.offsetTop);
}if(fixed){add(Math.max(doc.documentElement.scrollLeft,doc.body.scrollLeft),Math.max(doc.documentElement.scrollTop,doc.body.scrollTop));
}}results={top:top,left:left};
}}function border(elem){add(jQuery.curCSS(elem,"borderLeftWidth",true),jQuery.curCSS(elem,"borderTopWidth",true));
}function add(l,t){left+=parseInt(l,10)||0;
top+=parseInt(t,10)||0;
}return results;
};
jQuery.fn.extend({position:function(){var left=0,top=0,results;
if(this[0]){var offsetParent=this.offsetParent(),offset=this.offset(),parentOffset=/^body|html$/i.test(offsetParent[0].tagName)?{top:0,left:0}:offsetParent.offset();
offset.top-=num(this,"marginTop");
offset.left-=num(this,"marginLeft");
parentOffset.top+=num(offsetParent,"borderTopWidth");
parentOffset.left+=num(offsetParent,"borderLeftWidth");
results={top:offset.top-parentOffset.top,left:offset.left-parentOffset.left};
}return results;
},offsetParent:function(){var offsetParent=this[0].offsetParent;
while(offsetParent&&(!/^body|html$/i.test(offsetParent.tagName)&&jQuery.css(offsetParent,"position")=="static")){offsetParent=offsetParent.offsetParent;
}return jQuery(offsetParent);
}});
jQuery.each(["Left","Top"],function(i,name){var method="scroll"+name;
jQuery.fn[method]=function(val){if(!this[0]){return;
}return val!=undefined?this.each(function(){this==window||this==document?window.scrollTo(!i?val:jQuery(window).scrollLeft(),i?val:jQuery(window).scrollTop()):this[method]=val;
}):this[0]==window||this[0]==document?self[i?"pageYOffset":"pageXOffset"]||jQuery.boxModel&&document.documentElement[method]||document.body[method]:this[0][method];
};
});
jQuery.each(["Height","Width"],function(i,name){var tl=i?"Left":"Top",br=i?"Right":"Bottom";
jQuery.fn["inner"+name]=function(){return this[name.toLowerCase()]()+num(this,"padding"+tl)+num(this,"padding"+br);
};
jQuery.fn["outer"+name]=function(margin){return this["inner"+name]()+num(this,"border"+tl+"Width")+num(this,"border"+br+"Width")+(margin?num(this,"margin"+tl)+num(this,"margin"+br):0);
};
});
};
if(window.amznJQ){amznJQ.initJQuery=initJQuery;
}else{initJQuery();
}})();
(function(){var patchJQuery=function(jQuery){var $=jQuery;
if(!jQuery){return;
}jQuery.fn.offset126=jQuery.fn.offset;
if(document.documentElement["getBoundingClientRect"]){jQuery.fn.offset=function(){if(!this[0]){return{top:0,left:0};
}if(this[0]===this[0].ownerDocument.body){return jQuery.offset.bodyOffset(this[0]);
}var box=this[0].getBoundingClientRect(),doc=this[0].ownerDocument,body=doc.body,docElem=doc.documentElement,clientTop=docElem.clientTop||body.clientTop||0,clientLeft=docElem.clientLeft||body.clientLeft||0,top=box.top+(self.pageYOffset||jQuery.boxModel&&docElem.scrollTop||body.scrollTop)-clientTop,left=box.left+(self.pageXOffset||jQuery.boxModel&&docElem.scrollLeft||body.scrollLeft)-clientLeft;
return{top:top,left:left};
};
}else{jQuery.fn.offset=function(){if(!this[0]){return{top:0,left:0};
}if(this[0]===this[0].ownerDocument.body){return jQuery.offset.bodyOffset(this[0]);
}jQuery.offset.initialized||jQuery.offset.initialize();
var elem=this[0],offsetParent=elem.offsetParent,prevOffsetParent=elem,doc=elem.ownerDocument,computedStyle,docElem=doc.documentElement,body=doc.body,defaultView=doc.defaultView,prevComputedStyle=defaultView.getComputedStyle(elem,null),top=elem.offsetTop,left=elem.offsetLeft;
while((elem=elem.parentNode)&&elem!==body&&elem!==docElem){computedStyle=defaultView.getComputedStyle(elem,null);
top-=elem.scrollTop,left-=elem.scrollLeft;
if(elem===offsetParent){top+=elem.offsetTop,left+=elem.offsetLeft;
if(jQuery.offset.doesNotAddBorder&&!(jQuery.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(elem.tagName))){top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;
}prevOffsetParent=offsetParent,offsetParent=elem.offsetParent;
}if(jQuery.offset.subtractsBorderForOverflowNotVisible&&computedStyle.overflow!=="visible"){top+=parseInt(computedStyle.borderTopWidth,10)||0,left+=parseInt(computedStyle.borderLeftWidth,10)||0;
}prevComputedStyle=computedStyle;
}if(prevComputedStyle.position==="relative"||prevComputedStyle.position==="static"){top+=body.offsetTop,left+=body.offsetLeft;
}if(prevComputedStyle.position==="fixed"){top+=Math.max(docElem.scrollTop,body.scrollTop),left+=Math.max(docElem.scrollLeft,body.scrollLeft);
}return{top:top,left:left};
};
}jQuery.offset={initialize:function(){if(this.initialized){return;
}var body=document.body,container=document.createElement("div"),innerDiv,checkDiv,table,rules,prop,bodyMarginTop=body.style.marginTop,html='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"cellpadding="0"cellspacing="0"><tr><td></td></tr></table>';
rules={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};
for(prop in rules){container.style[prop]=rules[prop];
}container.innerHTML=html;
body.insertBefore(container,body.firstChild);
innerDiv=container.firstChild,checkDiv=innerDiv.firstChild,td=innerDiv.nextSibling.firstChild.firstChild;
this.doesNotAddBorder=(checkDiv.offsetTop!==5);
this.doesAddBorderForTableAndCells=(td.offsetTop===5);
innerDiv.style.overflow="hidden",innerDiv.style.position="relative";
this.subtractsBorderForOverflowNotVisible=(checkDiv.offsetTop===-5);
body.style.marginTop="1px";
this.doesNotIncludeMarginInBodyOffset=(body.offsetTop===0);
body.style.marginTop=bodyMarginTop;
body.removeChild(container);
this.initialized=true;
},bodyOffset:function(body){jQuery.offset.initialized||jQuery.offset.initialize();
var top=body.offsetTop,left=body.offsetLeft;
if(jQuery.offset.doesNotIncludeMarginInBodyOffset){top+=parseInt(jQuery.curCSS(body,"marginTop",true),10)||0,left+=parseInt(jQuery.curCSS(body,"marginLeft",true),10)||0;
}return{top:top,left:left};
}};
if(jQuery.browser.msie&&document.compatMode=="BackCompat"){var fixOriginal=jQuery.event.fix;
jQuery.event.fix=function(event){var e=fixOriginal(event);
e.pageX-=2;
e.pageY-=2;
return e;
};
}jQuery.fn.offsetNoIPadFix=jQuery.fn.offset;
jQuery.fn.offsetIPadFix=jQuery.fn.offset;
if(/webkit.*mobile/i.test(navigator.userAgent)&&parseFloat($.browser.version)<532.9&&"getBoundingClientRect" in document.documentElement){jQuery.fn.offsetIPadFix=function(){var result=this.offsetNoIPadFix();
result.top-=window.scrollY;
result.left-=window.scrollX;
return result;
};
if(typeof window.jQueryPatchIPadOffset!="undefined"&&window.jQueryPatchIPadOffset){jQuery.fn.offset=jQuery.fn.offsetIPadFix;
}}};
if(window.amznJQ&&amznJQ.initJQuery){var initJQuery=amznJQ.initJQuery;
amznJQ.initJQuery=function(){initJQuery();
patchJQuery(jQuery);
};
}else{patchJQuery(jQuery);
}})();

/* end jQuery-1.2.6/jquery.js */

/* begin amazonJQ/amznJQ.js */
(function(){var timesliceJS,initJQuery;
if(window.amznJQ){timesliceJS=amznJQ._timesliceJS;
initJQuery=amznJQ.initJQuery;
delete amznJQ._timesliceJS;
delete amznJQ.initJQuery;
}var isRunning=false,cbsWaiting=[];
var doDeferred=function(){;
isRunning=true;
var stopTime=(new Date()).getTime()+40;
var callingCB;
try{while(cbsWaiting.length&&(new Date()).getTime()<=stopTime){var cb=cbsWaiting.shift();
callingCB=true;
cb();
callingCB=false;
}}finally{if(callingCB){;
}if(cbsWaiting.length){;
setTimeout(doDeferred,0);
}else{;
isRunning=false;
}}};
var callInTimeslice=function(cbOrArray){if(typeof cbOrArray==="function"){cbsWaiting.push(cbOrArray);
}else{cbsWaiting=cbsWaiting.concat(cbOrArray);
}if(!isRunning){isRunning=true;
setTimeout(doDeferred,0);
}};
var initAmznJQ=function(){var $=window.jQuery,jQuery=$;
if(!jQuery){return;
}var bootstrapAmznJQ=window.amznJQ;
if(!window.goN2Debug){window.goN2Debug=new function(){this.info=function(){};
return this;
};
}window.amznJQ=new function(){;
var me=this;
me.jQuery=jQuery;
jQuery.noConflict(true);
if(window.jQuery){;
}else{window.jQuery=jQuery;
}var _logicalToPhysical={JQuery:{functionality:"JQuery",urls:null},popover:{functionality:"popover",urls:null}};
var _func_loaded={};
var _url_loaded={};
var _loading={};
function _loadFunctionality(functionality){var urls=_logicalToPhysical[functionality].urls;
if(urls){;
$.each(urls,function(){if(!_url_loaded[this]){_loadURL(this,functionality);
}});
}else{;
}}function _loadURL(url,functionality){;
$.ajax({type:"GET",url:url,success:_onUrlLoadedFcn(url,functionality),dataType:"script",cache:true});
}function _onUrlLoadedFcn(url,functionality){return function(){;
_url_loaded[url]=true;
var all_loaded=true;
$.each(_logicalToPhysical[functionality].urls,function(){all_loaded=all_loaded&&!!_url_loaded[this];
});
if(all_loaded){}};
}me.addLogical=function(functionality,urls){var ul=urls?urls.length:"no";
;
_logicalToPhysical[functionality]={functionality:functionality,urls:urls};
if(!urls){me.declareAvailable(functionality);
return;
}if(_loading[functionality]){_loadFunctionality(functionality);
}};
me.declareAvailable=function(functionality){;
if(typeof _logicalToPhysical[functionality]=="undefined"){_logicalToPhysical[functionality]={functionality:functionality,urls:null};
}_func_loaded[functionality]=true;
triggerEventCallbacks(functionality+".loaded");
};
me.addStyle=function(css_url){var dcss=document.styleSheets[0];
if(dcss&&dcss.addImport){while(dcss.imports.length>=31){dcss=dcss.imports[0];
}dcss.addImport(css_url);
}else{$("style[type='text/css']:first").append('@import url("'+css_url+'");');
}};
me.addStyles=function(args){var urls=args.urls||[];
var styles=args.styles||[];
var dcss=document.styleSheets;
if(dcss&&!dcss.length&&document.createStyleSheet){document.createStyleSheet();
}dcss=dcss[0];
if(dcss&&dcss.addImport){$.each(urls,function(){while(dcss.imports.length>=31){dcss=dcss.imports[0];
}dcss.addImport(this);
});
}else{$.each(urls,function(){var attrs={type:"text/css",rel:"stylesheet",href:this};
$("head").append($("<link/>").attr(attrs));
});
}var css="";
$.each(styles,function(){css+=this;
});
if(css){if(document.createStyleSheet){try{var sheet=document.createStyleSheet();
sheet.cssText=css;
}catch(e){}}else{$("head").append($("<style/>").attr({type:"text/css"}).append(css));
}}};
var eventCBQueue={};
var enqueueEventCallback=function(eventName,cb){if(!timesliceJS){$(document).one(eventName,cb);
return;
}var queue=eventCBQueue[eventName]||[];
queue.push(function(){cb(jQuery.event.fix({type:eventName}));
});
eventCBQueue[eventName]=queue;
};
var triggerEventCallbacks=function(eventName){if(!timesliceJS){$(document).trigger(eventName);
return;
}var queue=eventCBQueue[eventName];
if(queue){callInTimeslice(queue);
delete eventCBQueue[eventName];
}};
var doEventCallbackNow=function(eventName,cb){if(!timesliceJS){$(document).one(eventName,cb);
$(document).trigger(eventName);
}else{if(eventCBQueue[eventName]){enqueueEventCallback(eventName,cb);
triggerEventCallbacks(eventName);
}else{callInTimeslice(function(){cb(jQuery.event.fix({type:eventName}));
});
}}};
me.available=function(functionality,eventCallbackFunction){if(_func_loaded[functionality]){;
doEventCallbackNow(functionality+".loaded",eventCallbackFunction);
}else{if(_loading[functionality]){;
enqueueEventCallback(functionality+".loaded",eventCallbackFunction);
}else{if(_logicalToPhysical[functionality]){;
_loading[functionality]=true;
enqueueEventCallback(functionality+".loaded",eventCallbackFunction);
_loadFunctionality(functionality);
}else{;
_loading[functionality]=true;
enqueueEventCallback(functionality+".loaded",eventCallbackFunction);
}}}};
me.onReady=function(functionality,eventCallbackFunction){var ajq=this;
$(function(){ajq.available(functionality,eventCallbackFunction);
});
};
var _stage_completed={};
var _fail_safe_stages=["amznJQ.theFold","amznJQ.criticalFeature"];
me.onCompletion=function(stage,callbackFn){if(_stage_completed[stage]){;
doEventCallbackNow(stage,callbackFn);
}else{;
enqueueEventCallback(stage,callbackFn);
}};
me.completedStage=function(stage){if(!_stage_completed[stage]){;
_stage_completed[stage]=true;
triggerEventCallbacks(stage);
}};
me.windowOnLoad=function(){;
$.each(_fail_safe_stages,function(){if(!_stage_completed[this]){;
_stage_completed[this]=true;
triggerEventCallbacks(this);
}});
};
(function(){var plUrls=[],lowPriUrls=[],hiPriUrls=[],isLowPriEligibleYet=false,ST=setTimeout,doc=document,docElem=doc.documentElement,styleObj=docElem.style,nav=navigator,isGecko=("MozAppearance" in styleObj),isWebkit=!isGecko&&("webkitAppearance" in styleObj),isSafari=(isWebkit&&nav.vendor.indexOf("Apple")===0),isIE=!isGecko&&!isWebkit&&nav.appName.indexOf("Microsoft")===0,isMobile=(nav.userAgent.indexOf("Mobile")!=-1),allowedLoaders=window.plCount!==undefined?window.plCount():(((!isMobile&&(isWebkit||isGecko))||(isIE&&typeof XDomainRequest==="object"))?5:2),currentLoaders=0,timeout=2500;
function setLoadState(){if(hiPriUrls.length>0){plUrls=hiPriUrls;
}else{plUrls=lowPriUrls;
if(plUrls.length===0||!isLowPriEligibleYet){return false;
}}if(currentLoaders>=allowedLoaders){return false;
}currentLoaders++;
return true;
}function loaderDone(loader,timer){clearTimeout(timer);
currentLoaders=currentLoaders<1?0:currentLoaders-1;
destroyLoader(loader);
if(!isIE){load();
}else{ST(load,0);
}}function destroyElement(el){if(el){var p=el.parentElement;
if(p){p.removeChild(el);
}el=null;
}}var destroyLoader=function(loader){if(isGecko){setTimeout(function(){destroyElement(loader);
},5);
}else{destroyElement(loader);
}};
var load=!(isIE||isGecko||isWebkit)?function(){;
}:function(){if(!setLoadState()){return;
}var url=plUrls.pop(),loader,hL=plUrls===hiPriUrls?"H":"L",timer;
;
if(isGecko){loader=doc.createElement("object");
}else{if(isSafari){var end=url.indexOf("?");
end=end>0?end:url.length;
var posDot=url.lastIndexOf(".",end);
if(posDot){switch(url.substring(posDot+1,end).toLowerCase()){case"js":loader=doc.createElement("script");
loader.type="f";
break;
case"png":case"jpg":case"jpeg":case"gif":loader=new Image();
break;
}}if(!loader){;
loaderDone(url);
return;
}}else{loader=new Image();
}}loader.onerror=function(){;
loaderDone(loader,timer);
};
loader.onload=function(){;
loaderDone(loader,timer);
};
if(isGecko||(isSafari&&loader.tagName=="SCRIPT")){timer=ST(function(){;
loaderDone(loader,timer);
},timeout+Math.random()*100);
}if(isGecko){loader.data=url;
}else{loader.src=url;
}if(!isIE){loader.width=loader.height=0;
loader.style.display="none";
docElem.appendChild(loader);
}if(currentLoaders<allowedLoaders){load();
}};
function processUrlList(urlList,target){if(typeof(urlList)==="string"){urlList=[urlList];
}else{if(typeof(urlList)!=="object"||urlList===null){return;
}}var i,u;
for(i=0;
i<urlList.length;
i++){u=urlList[i];
if(u&&typeof(u)!=="string"){processUrlList(u,target);
}else{if(u&&!(u[0]==" ")){target.splice(Math.round(Math.random()*target.length),0,u);
}}}}me._getPLStat=function(){return{H:hiPriUrls.length,L:lowPriUrls.length,P:plUrls.length,CL:currentLoaders,AL:allowedLoaders};
};
me.addPL=function(urlList){processUrlList(urlList,lowPriUrls);
load();
};
me.PLNow=function(urlList){processUrlList(urlList,hiPriUrls);
load();
};
function triggerPagePreloads(){isLowPriEligibleYet=true;
load();
}if(typeof bootstrapAmznJQ.PLTriggerName!=="undefined"){amznJQ.available(bootstrapAmznJQ.PLTriggerName,triggerPagePreloads);
}else{$(window).load(function(){ST(triggerPagePreloads,1000);
});
}}());
me.strings={};
me.chars={};
if(bootstrapAmznJQ){$.extend(this.strings,bootstrapAmznJQ.strings);
$.extend(this.chars,bootstrapAmznJQ.chars);
}}();
$(window).load(function(){amznJQ.windowOnLoad();
});
if(window.ue&&bootstrapAmznJQ&&window.ues&&window.uex){ues("wb","jQueryActive",1);
uex("ld","jQueryActive");
}amznJQ.declareAvailable("JQuery");
amznJQ.declareAvailable("jQuery");
if(bootstrapAmznJQ){;
$.each(bootstrapAmznJQ._l,function(){amznJQ.addLogical(this[0],this[1]);
});
$.each(bootstrapAmznJQ._s,function(){amznJQ.addStyle(this[0]);
});
$.each(bootstrapAmznJQ._d,function(){amznJQ.declareAvailable(this[0],this[1]);
});
$.each(bootstrapAmznJQ._a,function(){amznJQ.available(this[0],this[1]);
});
$.each(bootstrapAmznJQ._t||[],function(){callInTimeslice(this[0]);
});
$.each(bootstrapAmznJQ._o,function(){amznJQ.onReady(this[0],this[1]);
});
$.each(bootstrapAmznJQ._c,function(){amznJQ.onCompletion(this[0],this[1]);
});
$.each(bootstrapAmznJQ._cs,function(){amznJQ.completedStage(this[0],this[1]);
});
amznJQ.addPL(bootstrapAmznJQ._pl);
}};
if(!initJQuery){initAmznJQ();
}else{if(!timesliceJS){initJQuery();
initAmznJQ();
}else{callInTimeslice(initJQuery);
callInTimeslice(initAmznJQ);
}}})();

/* end amazonJQ/amznJQ.js */

/* begin popover/amzPopover.js */
amznJQ.available("jQuery",function(){(function($){if(!$){return;
}var rootElement=function(){var container=$("#ap_container");
return container.length&&container||$("body");
};
var viewport={width:function(){return Math.min($(window).width(),$(document).width());
},height:function(){return $(window).height();
}};
var mouseTracker=function(){var regions=[],n=3,cursor=[{x:0,y:0}],c=0,scroll=[0,0],listening=false;
var callbackArgs=function(){var pCursors=[];
for(var i=1;
i<n;
i++){pCursors.push(cursor[(c-i+n)%n]);
}return $.extend(true,{},{cursor:cursor[c],priorCursors:pCursors});
};
var check=function(immediately){for(var i=0;
i<regions.length;
i++){var r=regions[i];
var inside=$.grep(r.rects,function(n){return cursor[c].x>=n[0]&&cursor[c].y>=n[1]&&cursor[c].x<n[0]+n[2]&&cursor[c].y<n[1]+n[3];
}).length>0;
if(r.inside!==null&&inside&&!r.inside&&r.mouseEnter){r.inside=r.mouseEnter(callbackArgs());
}else{if(r.inside!==null&&!inside&&r.inside&&r.mouseLeave){r.inside=!r.mouseLeave(immediately,callbackArgs());
}}}};
var startListening=function(){scroll=[$(window).scrollLeft(),$(window).scrollTop()];
$(document).mousemove(function(e){c=(c+1)%n;
cursor[c]={x:e.pageX,y:e.pageY};
check();
});
if(!isMobileAgent(true)){$(document).scroll(function(e){cursor[c].x+=($(window).scrollLeft()-scroll[0]);
cursor[c].y+=($(window).scrollTop()-scroll[1]);
scroll=[$(window).scrollLeft(),$(window).scrollTop()];
check();
});
}listening=true;
};
return{add:function(rectsArray,options){if(!listening){startListening();
}var r=$.extend({rects:rectsArray},options);
regions.push(r);
return r;
},remove:function(region){for(var i=0;
i<regions.length;
i++){if(regions[i]===region){regions.splice(i,1);
return;
}}},checkNow:function(){check(true);
},getCallbackArgs:function(){return callbackArgs();
}};
}();
var iframePool=function(){var ie6=$.browser.msie&&parseInt($.browser.version)<=6;
var src=ie6?window.AmazonPopoverImages.pixel:"javascript:void(false)";
var HTML='<iframe frameborder="0" tabindex="-1" src="'+src+'" style="display:none;position:absolute;z-index:0;filter:Alpha(Opacity=\'0\');opacity:0;" />';
var pool=[];
var addToLib=function(n){for(i=0;
i<n;
i++){pool.push($(HTML).prependTo(rootElement()));
}};
$(document).ready(function(){addToLib(3);
});
return{checkout:function(jqObj){if(!pool.length){addToLib(1);
}return pool.pop().css({display:"block",top:jqObj.offset().top,left:jqObj.offset().left,width:jqObj.outerWidth(),height:jqObj.outerHeight(),zIndex:Number(jqObj.css("z-index"))-1});
},checkin:function(iframe){pool.push(iframe.css("display","none"));
}};
}();
var elementHidingManager=function(){var hiddenElements=[];
var win=/Win/.test(navigator.platform);
var mac=/Mac/.test(navigator.platform);
var linux=/Linux/.test(navigator.platform);
var version=parseInt($.browser.version);
var canOverlayWmodeWindow=false;
var intersectingPopovers=function(obj){var bounds=[obj.offset().left,obj.offset().top,obj.outerWidth(),obj.outerHeight()];
var intersecting=[];
for(var i=0;
i<popovers.length;
i++){var disparate=false;
if(!popovers[i].settings.modal){var r=popovers[i].bounds;
disparate=bounds[0]>r[0]+r[2]||r[0]>bounds[0]+bounds[2]||bounds[1]>r[1]+r[3]||r[1]>bounds[1]+bounds[3];
}if(!disparate){intersecting.push(popovers[i]);
}}return intersecting;
};
var shouldBeVisible=function(obj){if(obj.hasClass("ap_never_hide")){return true;
}if(intersectingPopovers(obj).length){if(obj.is("object,embed")){var wmode=obj.attr("wmode")||obj.children("object,embed").attr("wmode")||obj.parent("object,embed").attr("wmode")||"window";
if(wmode.toLowerCase()=="window"&&!canOverlayWmodeWindow){return false;
}}if(obj.is("iframe")){if($.browser.safari){return false;
}}}return true;
};
var setVisibility=function(elementQuery,shouldBecomeVisible){if(elementQuery.is("iframe[id^=DA],iframe[id^=cachebust]")){elementQuery.css({display:shouldBecomeVisible?"block":"none"});
}else{elementQuery.css({visibility:shouldBecomeVisible?"visible":"hidden"});
}};
return{update:function(){var HIDDEN=0;
var VISIBLE=1;
var stillHidden=[];
for(var i=0;
i<hiddenElements.length;
i++){var hiddenElement=hiddenElements[i];
if(!shouldBeVisible(hiddenElement)){stillHidden.push(hiddenElement);
}else{setVisibility(hiddenElement,VISIBLE);
}}hiddenElements=stillHidden;
$("object:visible,embed:visible,iframe:visible").each(function(){var obj=jQuery(this);
if(!shouldBeVisible(obj)){hiddenElements.push(obj);
setVisibility(obj,HIDDEN);
}});
}};
}();
var applyBacking=function(popover,options){var region=null;
var iframe=null;
options=options||{};
var destroy=function(){if(region){mouseTracker.remove(region);
region=null;
}if(iframe){iframePool.checkin(iframe);
iframe=null;
}elementHidingManager.update();
};
var refreshBounds=function(){var newBounds=[popover.offset().left,popover.offset().top,popover.outerWidth(),popover.outerHeight()];
if(region){region.rects[0]=newBounds;
}if(iframe){iframe.css({left:newBounds[0],top:newBounds[1],width:newBounds[2],height:newBounds[3]});
}elementHidingManager.update();
};
var reposition=function(x,y){if(iframe){iframe.css({left:x,top:y});
}if(region){region.rects[0][0]=x;
region.rects[0][1]=y;
}};
if(options.useIFrame!==false){iframe=iframePool.checkout(popover);
}var bounds=[[popover.offset().left,popover.offset().top,popover.outerWidth(),popover.outerHeight()]];
if(options.additionalCursorRects){for(var i=0;
i<options.additionalCursorRects.length;
i++){bounds.push(options.additionalCursorRects[i]);
}}region=mouseTracker.add(bounds,options);
elementHidingManager.update();
popover.backing={destroy:destroy,refreshBounds:refreshBounds,reposition:reposition,iframe:iframe};
};
var defaultSettings={width:500,followScroll:false,locationMargin:4,alignMargin:0,windowMargin:4,locationFitInWindow:true,focusOnShow:true,modal:false,draggable:false,zIndex:200,showOnHover:false,hoverShowDelay:400,hoverHideDelay:200,skin:"default",useIFrame:true,clone:false,ajaxSlideDuration:400,ajaxErrorContent:null,paddingLeft:17,paddingRight:17,paddingBottom:8};
var overlay=null;
var popovers=[];
var et={MOUSE_ENTER:1,MOUSE_LEAVE:2,CLICK_TRIGGER:4,CLICK_OUTSIDE:8,fromStrings:function(s){var flags=0;
var self=this;
if(s){$.each($.makeArray(s),function(){flags=flags|self[this];
});
}return flags;
}};
var ajaxCache={};
var preparedPopover=null;
var openGroupPopover={};
var skins={"default":'<div class="ap_popover ap_popover_sprited" surround="6,16,18,16" tabindex="0">                     <div class="ap_header">                         <div class="ap_left"/>                         <div class="ap_middle"/>                         <div class="ap_right"/>                     </div>                     <div class="ap_body">                         <div class="ap_left"/>                         <div class="ap_content"><img src="'+window.AmazonPopoverImages.snake+'"/></div>                         <div class="ap_right"/>                     </div>                     <div class="ap_footer">                         <div class="ap_left"/>                         <div class="ap_middle"/>                         <div class="ap_right"/>                     </div>                     <div class="ap_titlebar">                         <div class="ap_title"/>                     </div>                     <div class="ap_close"><a href="#"><span class="ap_closetext"/><span class="ap_closebutton"><span></span></span></a></div>                 </div>',"default_non_sprited":'<div class="ap_popover ap_popover_unsprited" surround="6,16,18,16" tabindex="0">                     <div class="ap_header">                         <div class="ap_left"/>                         <div class="ap_middle"/>                         <div class="ap_right"/>                     </div>                     <div class="ap_body">                         <div class="ap_left"/>                         <div class="ap_content"><img src="'+window.AmazonPopoverImages.snake+'"/></div>                         <div class="ap_right"/>                     </div>                     <div class="ap_footer">                         <div class="ap_left"/>                         <div class="ap_middle"/>                         <div class="ap_right"/>                     </div>                     <div class="ap_titlebar">                         <div class="ap_title"/>                     </div>                     <div class="ap_close"><a href="#"><span class="ap_closetext"/><img border="0" src="'+window.AmazonPopoverImages.btnClose+'"/></a></div>                 </div>',"classic":'<div class="ap_classic">                     <div class="ap_titlebar">                         <div class="ap_close">                             <img width="46" height="16" border="0" alt="close" onmouseup=\'this.src="'+window.AmazonPopoverImages.closeTan+"\";' onmouseout='this.src=\""+window.AmazonPopoverImages.closeTan+"\";' onmousedown='this.src=\""+window.AmazonPopoverImages.closeTanDown+'";\' src="'+window.AmazonPopoverImages.closeTan+'" />                         </div>                         <span class="ap_title"></span>                     </div>                     <div class="ap_content"><img src="'+window.AmazonPopoverImages.loadingBar+'"/></div>                 </div>'};
var boundingRectangle=function(set){var b={left:Infinity,top:Infinity,right:-Infinity,bottom:-Infinity};
set.each(function(){try{var t=$(this);
var o=t.offset();
var w=t.outerWidth();
var h=t.outerHeight();
if(t.is("area")){var ab=boundsOfAreaElement(t);
o={left:ab[0],top:ab[1]};
w=ab[2]-ab[0];
h=ab[3]-ab[1];
}if(o.left<b.left){b.left=o.left;
}if(o.top<b.top){b.top=o.top;
}if(o.left+w>b.right){b.right=o.left+w;
}if(o.top+h>b.bottom){b.bottom=o.top+h;
}}catch(e){}});
return b;
};
var bringToFront=function(popover){if(popovers.length<=1){return;
}var maxZ=Math.max.apply(Math,$.map(popovers,function(p){return Number(p.css("z-index"));
}));
if(Number(popover.css("z-index"))==maxZ){return;
}popover.css("z-index",maxZ+2);
popover.backing&&popover.backing.iframe.css("z-index",maxZ+1);
};
$.fn.removeAmazonPopoverTrigger=function(){this.unbind("click.amzPopover");
this.unbind("mouseover.amzPopover");
this.unbind("mouseout.amzPopover");
return this;
};
$.fn.amazonPopoverTrigger=function(customSettings){var settings=$.extend({},defaultSettings,customSettings);
var triggers=this;
var popover=null;
if(!settings.showOnHover&&settings.skin=="default"){this.bind("mouseover.amzPopover",preparePopover);
}if(typeof settings.showOnHover=="string"){var hoverSet=triggers.filter(settings.showOnHover);
}else{var hoverSet=settings.showOnHover?triggers:jQuery([]);
}var timerID=null;
hoverSet.bind("mouseover.amzPopover",function(e){if(!popover&&!timerID){timerID=setTimeout(function(){if(!popover){var parent=triggers.parent(),length=parent.length,tagName=length?parent.attr("tagName")||parent.get(0).tagName:undefined;
if(length&&tagName){if(!settings.triggeringEnabled||settings.triggeringEnabled.call(triggers)){popover=displayPopover(settings,triggers,function(){popover=null;
});
}}}timerID=null;
},settings.hoverShowDelay);
}return false;
});
hoverSet.bind("mouseout.amzPopover",function(e){if(!popover&&timerID){clearTimeout(timerID);
timerID=null;
}});
triggers.bind("click.amzPopover",function(e){var followLink=settings.followLink===true||typeof settings.followLink=="function"&&settings.followLink.call(triggers,popover,settings);
if(followLink){return true;
}if(popover){popover.triggerClicked();
}else{if(!settings.triggeringEnabled||settings.triggeringEnabled.call(triggers)){popover=displayPopover(settings,triggers,function(){popover=null;
});
}}return false;
});
this.amznPopoverHide=function(){popover&&popover.close();
};
this.amznPopoverVisible=function(){return !!popover;
};
return this;
};
var updateBacking=function(group){if(group&&openGroupPopover[group]){var popover=openGroupPopover[group];
if(popover.backing){popover.backing.refreshBounds();
}}};
var displayPopover=function(settings,triggers,destroyFunction){addAliases(settings);
var parent=null;
if(triggers){var parents=triggers.eq(0).parents().get();
for(var t=0;
t<parents.length&&!parent;
t++){for(var i=0;
i<popovers.length&&!parent;
i++){if(popovers[i].get(0)==parents[t]){parent=popovers[i];
}}}}var children=[];
children.remove=function(p){for(var i=0;
i<this.length;
i++){if(this[i]===p){this.splice(i,1);
return;
}}};
var interactedWith=false;
$.each(defaultSettings,function(k,v){if(typeof settings[k]=="undefined"){settings[k]=v;
}});
if(!settings.location){settings.location=settings.modal||!triggers?"centered":"auto";
}if(settings.showCloseButton===null){settings.showCloseButton=!settings.showOnHover;
}$.each(popovers,function(){settings.zIndex=Math.max(settings.zIndex,Number(this.css("z-index"))+2);
});
var closeEvent=(settings.showOnHover?et.MOUSE_LEAVE:et.CLICK_TRIGGER)|(settings.modal?et.CLICK_OUTSIDE:0);
closeEvent=(closeEvent|et.fromStrings(settings.closeEventInclude))&~et.fromStrings(settings.closeEventExclude);
var clickAwayHandler;
var close=function(){if(settings.group){openGroupPopover[settings.group]=null;
}if(original&&original.parents("body").length){if(ballMarker&&ballMarker.parents("body").length){original.hide().insertAfter(ballMarker);
ballMarker.remove();
ballMarker=null;
}else{original.hide().appendTo(rootElement());
}}if(original!=popover){popover.remove();
}if(parent){parent.children.remove(popover);
}for(var i=0;
i<popovers.length;
i++){if(popovers[i]===popover){popovers.splice(i,1);
break;
}}if(popover.backing){popover.backing.destroy();
popover.backing=null;
}mouseTracker.checkNow();
if(destroyFunction){destroyFunction();
}if(settings.onHide){settings.onHide.call(triggers,popover,settings);
}if(settings.modal&&overlay){if(overlay.fitToScreen){$(window).unbind("resize",overlay.fitToScreen);
}overlay.remove();
overlay=null;
}$(document).unbind("scroll.AmazonPopover");
$(document).unbind("click",clickAwayHandler);
for(var i=0;
i<children.length;
i++){children[i].close();
}children=[];
return false;
};
var fill=function(content,autoshow){var container=popover.find(".ap_sub_content");
if(container.length==0){container=popover.find(".ap_content");
}if(typeof content=="string"){container.html(content);
}else{container.empty().append(content);
}if(typeof settings.autoshow=="boolean"?settings.autoshow:autoshow){if($.browser.msie){container.children().show().hide();
}container.children(":not(style)").show();
}container.find(".ap_custom_close").click(close);
if(settings.onFilled){settings.onFilled.call(triggers,popover,settings);
}return container;
};
if(settings.modal&&!overlay){overlay=showOverlay(close,settings.zIndex);
}var popover=null;
var original=null;
var ballMarker=null;
if(settings.skin=="default"){preparePopover();
popover=preparedPopover;
preparedPopover=null;
}else{var skin=$.isFunction(settings.skin)?settings.skin():settings.skin;
skin=skin||"<div><div class='ap_content' /></div>";
var skinIsHtml=/^[^<]*(<(.|\s)+>)[^>]*$/.test(skin);
var skinHtml=(skinIsHtml?skin:skins[skin]);
popover=$(skinHtml);
}if($.browser.msie&&parseInt($.browser.version)==6){fixPngs(popover);
}if(settings.skin=="default"){popover.find(".ap_content").css({paddingLeft:settings.paddingLeft,paddingRight:settings.paddingRight,paddingBottom:settings.paddingBottom});
}if(settings.localContent){if(settings.clone){fill($(settings.localContent).clone(true),true);
}else{original=$(settings.localContent);
ballMarker=$("<span style='display:none' />").insertBefore(original);
fill(original,true);
}}else{if(settings.literalContent){fill(settings.literalContent);
}}if(settings.destination){var destinationUrl=(typeof settings.destination=="function")?settings.destination():settings.destination;
if(settings.cacheable!==false&&ajaxCache[destinationUrl]){fill(ajaxCache[destinationUrl]);
}else{$.ajax({url:destinationUrl,timeout:settings.ajaxTimeout,success:function(data){if(settings.onAjaxSuccess){settings.onAjaxSuccess.apply(settings,arguments);
}var contentCacheable=data.match(/^(\s|<!--[\s\S]*?-->)*<\w+[^>]*\s+cacheable="(.*?)"/i)||data.match(/^(\s|<!--[\s\S]*?-->)*<\w+[^>]*\s+cacheable='(.*?)'/i);
if(settings.cacheable!==false&&(!contentCacheable||contentCacheable[2]!=="0")){ajaxCache[destinationUrl]=data;
}var title=data.match(/^(\s|<!--[\s\S]*?-->)*<\w+[^>]*\s+popoverTitle="(.*?)"/i)||data.match(/^(\s|<!--[\s\S]*?-->)*<\w+[^>]*\s+popoverTitle='(.*?)'/i);
if(title){settings.title=title[2];
popover.find(".ap_title").html(settings.title);
}if(settings.ajaxSlideDuration>0&&!($.browser.msie&&document.compatMode=="BackCompat")){popover.find(".ap_content").hide();
fill(data);
if(!settings.width){position(popover,settings,triggers);
}if(settings.onAjaxShow){settings.onAjaxShow.call(triggers,popover,settings);
}popover.find(".ap_content").slideDown(settings.ajaxSlideDuration,function(){position(popover,settings,triggers);
});
}else{fill(data);
if(settings.onAjaxShow){settings.onAjaxShow.call(triggers,popover,settings);
}position(popover,settings,triggers);
}},error:function(){var data=null;
if(typeof settings.ajaxErrorContent=="function"){data=settings.ajaxErrorContent.apply(settings,arguments);
}else{data=settings.ajaxErrorContent;
}if(data!==null){var container=fill(data);
var title=container.children("[popoverTitle]").attr("popoverTitle");
if(title){popover.find(".ap_title").html(title);
}position(popover,settings,triggers);
}}});
}}if(!settings.localContent&&!settings.literalContent&&!settings.destination){throw ("AmazonPopover wasn't provided a source of content.");
}if(parent){parent.children.push(popover);
}settings.surround=jQuery.map((popover.attr("surround")||"0,0,0,0").split(","),function(n){return Number(n);
});
popover.css({zIndex:settings.zIndex,position:"absolute",left:-2000,top:-2000});
popover.click(function(e){if(!e.metaKey){e.stopPropagation();
}interactedWith=true;
});
clickAwayHandler=function(e){var leftButton=e.button===0||e.which==1;
if(leftButton&&!e.metaKey){close();
}};
if(closeEvent&et.CLICK_OUTSIDE){$(document).click(clickAwayHandler);
}popover.mousedown(function(e){if(!children.length){bringToFront(popover);
}});
var width=settings.width&&(typeof settings.width=="function"?settings.width():settings.width);
if(!width){width=getDynamicWidth(popover,settings)||popover.outerWidth();
}if(width){popover.css("width",width);
}if(settings.followScroll){$(document).bind("scroll.AmazonPopover",function(e){followScroll(e);
});
}if(settings.title!==null&&settings.title!==undefined){var titleBar=popover.find(".ap_titlebar");
if(settings.skin=="default"){titleBar.css({width:(width-36)});
titleBar.find(".ap_title").css("width",width-70);
popover.find(".ap_content").css({paddingTop:18});
}popover.find(".ap_title").html(settings.title);
if(settings.draggable&&!settings.modal){enableDragAndDrop(titleBar,popover);
}titleBar.show();
if(settings.skin=="default"&&settings.wrapTitlebar){titleBar.addClass("multiline");
popover.find(".ap_content").css({paddingTop:titleBar.outerHeight()-9});
}}else{popover.find(".ap_titlebar").hide();
}if(settings.showCloseButton!==false){popover.find(".ap_close").show().click(close).mousedown(function(e){e.preventDefault();
e.stopPropagation();
return false;
}).css("cursor","default");
if(!settings.title){popover.find(".ap_content").css({paddingTop:10});
}popover.keydown(function(e){if(e.keyCode==27){close();
}});
}else{popover.find(".ap_close").css("display","none");
}if(settings.closeText){popover.find(".ap_closetext").text(settings.closeText).show();
}else{popover.find(".ap_closebutton span").text("Close");
}popover.appendTo(rootElement());
position(popover,settings,triggers);
$(document.activeElement).filter("input[type=text], select").blur();
popover.close=close;
if(settings.group){if(openGroupPopover[settings.group]){openGroupPopover[settings.group].close();
}openGroupPopover[settings.group]=popover;
}popover.show();
if(settings.focusOnShow){popover.get(0).hideFocus=true;
popover.focus();
}if(overlay&&overlay.snapToLeft){overlay.snapToLeft();
}if(settings.onShow){settings.onShow.call(triggers,popover,settings);
}popover.bounds=[popover.offset().left,popover.offset().top,popover.outerWidth(),popover.outerHeight()];
popovers.push(popover);
popover.close=close;
popover.settings=settings;
popover.triggerClicked=function(){if(closeEvent&et.CLICK_TRIGGER){close();
}};
popover.children=children;
if(closeEvent&et.MOUSE_LEAVE){var timerID=null;
var triggerRects=[];
$.each(triggers,function(){var n=$(this);
if(n.is("area")){var b=boundsOfAreaElement(n);
triggerRects.push([b[0],b[1],b[2]-b[0],b[3]-b[1]]);
}else{triggerRects.push([n.offset().left,n.offset().top,n.outerWidth(),n.outerHeight()]);
}});
if(settings.additionalCursorRects){$(settings.additionalCursorRects).each(function(){var n=$(this);
triggerRects.push([n.offset().left,n.offset().top,n.outerWidth(),n.outerHeight()]);
});
}applyBacking(popover,{solidRectangle:settings.solidRectangle,useIFrame:settings.useIFrame,mouseEnter:function(){if(timerID){clearTimeout(timerID);
timerID=null;
}return true;
},mouseLeave:function(immediately){if(settings.semiStatic&&interactedWith){return !children.length;
}if(timerID){clearTimeout(timerID);
timerID=null;
}if(children.length==0){if(immediately){close();
}else{timerID=setTimeout(function(){close();
timerID=null;
},settings.hoverHideDelay);
}return true;
}return false;
},additionalCursorRects:triggerRects,inside:true});
}else{applyBacking(popover,{solidRectangle:settings.solidRectangle,useIFrame:settings.useIFrame});
}$(function(){for(var i=0;
i<popovers.length;
i++){if(popovers[i].settings.modal){popovers[i].backing.refreshBounds();
}}});
return popover;
};
var isMobileAgent=function(includeFire){var reStr="(iPhone|iPad"+(includeFire?"|Silk/|Kindle Fire":"")+")";
return navigator.userAgent.match(new RegExp(reStr,"i"));
};
var getPageWidth=function(){return $.browser.msie?$(window).width():"100%";
};
var getPageHeight=function(){return $.browser.msie||isMobileAgent()?$(document).height():"100%";
};
var showOverlay=function(closeFunction,z){var overlay=$('<div id="ap_overlay"/>');
if($.browser.msie){overlay.fitToScreen=function(e){var windowHeight=$(document).height();
var windowWidth=$(window).width();
var children=overlay.children();
overlay.css({width:windowWidth,height:windowHeight,backgroundColor:"transparent",zIndex:z});
var appendElements=[];
for(var i=0;
i<children.size()||(windowHeight-(i*2000)>0);
i++){var paneHeight=Math.min(windowHeight-(i*2000),2000);
if(paneHeight>0){if(i<children.size()){children.eq(i).css({width:windowWidth,height:paneHeight});
}else{var slice=$("<div/>").css({opacity:0.4,zIndex:z,width:windowWidth,height:paneHeight,top:(i*2000)});
appendElements.push(slice[0]);
}}else{children.eq(i).remove();
}}if(appendElements.length){overlay.append(appendElements);
}};
overlay.snapToLeft=function(){overlay.css("left",jQuery(document).scrollLeft());
};
$(window).bind("resize load",overlay.fitToScreen);
$(window).scroll(overlay.snapToLeft);
overlay.snapToLeft();
overlay.fitToScreen();
}else{overlay.css({width:getPageWidth(),height:getPageHeight(),position:($.browser.mozilla||$.browser.safari)?"fixed":"",opacity:0.4,zIndex:z});
}return overlay.appendTo(rootElement());
};
var HEADER_HEIGHT=45;
var FOOTER_HEIGHT=35;
var VERT_ARROW_OFFSET=327;
var LEFT_ARROW_OFFSET=0;
var RIGHT_ARROW_OFFSET=-51;
var attachedPositioning=function(popover,targetY,location,position,offset){if(popover.hasClass("ap_popover_sprited")){var dist=targetY-location.top-offset[1];
if(dist<HEADER_HEIGHT){dist=HEADER_HEIGHT;
}else{if(dist>popover.outerHeight()-FOOTER_HEIGHT){dist=popover.outerHeight()-FOOTER_HEIGHT;
}}var attachingSide=position=="left"?"right":"left";
var elm=popover.find(".ap_body .ap_"+attachingSide);
if(elm.length>0){elm.removeClass("ap_"+attachingSide).addClass("ap_"+attachingSide+"-arrow");
}else{elm=popover.find(".ap_body .ap_"+attachingSide+"-arrow");
}var xOffset=attachingSide=="left"?LEFT_ARROW_OFFSET:RIGHT_ARROW_OFFSET;
elm.css("backgroundPosition",xOffset+"px "+(dist-VERT_ARROW_OFFSET)+"px");
}};
var position=function(popover,settings,triggers){if(!settings.width){popover.css("width",getDynamicWidth(popover,settings));
}var offset=settings.locationOffset||[0,0];
if(typeof settings.location=="function"){var location=settings.location.call(triggers,popover,settings);
}else{var names=$.map($.makeArray(settings.location),function(n){return n=="auto"?["bottom","left","right","top"]:n;
});
var set=settings.locationElement&&$(settings.locationElement)||triggers;
var b=set&&boundingRectangle(set);
var location=locationFunction[names[0]](b,popover,settings);
var index=0;
for(var i=1;
i<names.length&&!location.fits;
i++){var next=locationFunction[names[i]](b,popover,settings);
if(next.fits){location=next;
index=i;
}}if(settings.attached&&(names[index]=="left"||names[index]=="right")){attachedPositioning(popover,(b.top+b.bottom)/2,location,names[index],offset);
}}popover.css({left:location.left+offset[0],top:location.top+offset[1],margin:location.margin,right:location.right});
if(popover.backing){popover.backing.refreshBounds();
}};
var horizPosition=function(b,popover,settings){var align=$.makeArray(settings.align||"left");
var x={min:$(document).scrollLeft()+settings.windowMargin-settings.surround[3],max:viewport.width()+$(document).scrollLeft()-settings.windowMargin-popover.outerWidth(),left:b.left-settings.surround[3]-settings.alignMargin,right:b.right-popover.outerWidth()+settings.surround[1]+settings.alignMargin,center:(b.left+b.right-popover.outerWidth())/2};
var align=$.grep($.makeArray(settings.align),function(n){return x[n];
});
if(align.length==0){align.push("left");
}for(var i=0;
i<align.length;
i++){if(x[align[i]]>=x.min&&x[align[i]]<=x.max){return x[align[i]];
}}if(settings.forceAlignment){return x[align[0]];
}if(x.min>x.max){return x.min;
}return x[align[0]]<x.min?x.min:x.max;
};
var vertPosition=function(b,popover,settings){var min=$(document).scrollTop()+settings.windowMargin;
var max=viewport.height()+$(document).scrollTop()-settings.windowMargin;
if(settings.attached){var midpoint=(b.top+b.bottom)/2;
if(midpoint-HEADER_HEIGHT<min){min=min+HEADER_HEIGHT<b.bottom?min:b.bottom-HEADER_HEIGHT;
}if(midpoint+FOOTER_HEIGHT>max){max=max-FOOTER_HEIGHT>b.top?max:b.top+FOOTER_HEIGHT;
}}else{min=Math.min(b.top-settings.alignMargin,min);
max=Math.max(b.bottom+settings.alignMargin,max);
}var y={min:min-settings.surround[0],max:max-popover.outerHeight()+settings.surround[2],top:b.top-settings.surround[0]-settings.alignMargin,bottom:b.bottom-popover.outerHeight()+settings.alignMargin+settings.surround[2],middle:(b.top+b.bottom-popover.outerHeight())/2};
var align=$.grep($.makeArray(settings.align),function(n){return y[n];
});
if(align.length==0){align.push("top");
}for(var i=0;
i<align.length;
i++){if(y[align[i]]>=y.min&&y[align[i]]<=y.max){return y[align[i]];
}}if(settings.forceAlignment){return y[align[0]];
}if(y.min>y.max){return y.min;
}return y[align[0]]<y.min?y.min:y.max;
};
var locationFunction={centered:function(b,popover,settings){var y=$(window).scrollTop()+100;
return{left:-(popover.outerWidth()/2),right:0,top:y,margin:"0% 50%",fits:true};
},top:function(b,popover,settings){var room=b.top-$(document).scrollTop()-settings.locationMargin*2;
var triggerInView=(b.left>=$(document).scrollLeft())&&(b.right<viewport.width()+$(document).scrollLeft());
return{left:horizPosition(b,popover,settings),top:b.top-popover.outerHeight()-settings.locationMargin+settings.surround[2],fits:triggerInView&&room>=popover.outerHeight()-settings.surround[0]-settings.surround[2]};
},left:function(b,popover,settings){var room=b.left-$(document).scrollLeft()-settings.locationMargin*2;
return{left:b.left-popover.outerWidth()-settings.locationMargin+settings.surround[1],top:vertPosition(b,popover,settings),fits:room>=popover.outerWidth()-settings.surround[1]-settings.surround[3]};
},bottom:function(b,popover,settings){var room=(viewport.height()+$(document).scrollTop())-b.bottom-settings.locationMargin*2;
var triggerInView=(b.left>=$(document).scrollLeft())&&(b.right<viewport.width()+$(document).scrollLeft());
return{left:horizPosition(b,popover,settings),top:b.bottom+settings.locationMargin-settings.surround[0],fits:triggerInView&&room>=popover.outerHeight()-settings.surround[0]-settings.surround[2]};
},right:function(b,popover,settings){var room=(viewport.width()+$(document).scrollLeft())-b.right-settings.locationMargin*2;
return{left:b.right+settings.locationMargin-settings.surround[3],top:vertPosition(b,popover,settings),fits:room>=popover.outerWidth()-settings.surround[1]-settings.surround[3]};
},over:function(b,popover,settings){var alignTo=popover.find(settings.align||".ap_content *").offset();
var corner=popover.offset();
var padding={left:alignTo.left-corner.left,top:alignTo.top-corner.top};
var left=b.left-padding.left;
var top=b.top-padding.top;
var adjustedLeft=Math.min(left,viewport.width()+$(document).scrollLeft()-popover.outerWidth()-settings.windowMargin);
adjustedLeft=Math.max(adjustedLeft,$(document).scrollLeft()-settings.surround[3]+settings.windowMargin);
var adjustedTop=Math.min(top,viewport.height()+$(document).scrollTop()-popover.outerHeight()+settings.surround[2]-settings.windowMargin);
adjustedTop=Math.max(adjustedTop,$(document).scrollTop()-settings.surround[0]+settings.windowMargin);
return{left:settings.forceAlignment?left:adjustedLeft,top:settings.forceAlignment?top:adjustedTop,fits:left==adjustedLeft&&top==adjustedTop};
}};
var addAliases=function(settings){settings.align=settings.align||settings.locationAlign;
settings.literalContent=settings.literalContent||settings.loadingContent;
};
var preparePopover=function(){if(!preparedPopover){var ie6=jQuery.browser.msie&&parseInt(jQuery.browser.version)<=6;
preparedPopover=$(skins[ie6?"default_non_sprited":"default"]).css({left:-2000,top:-2000}).appendTo(rootElement());
}};
var fixPngs=function(obj){obj.find("*").each(function(){var match=(jQuery(this).css("background-image")||"").match(/url\("(.*\.png)"\)/);
if(match){var png=match[1];
jQuery(this).css("background-image","none");
jQuery(this).get(0).runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+png+"',sizingMethod='scale')";
}});
};
var getDynamicWidth=function(popover,settings){var container=popover.find(".ap_content");
if(settings.skin=="default"&&container.length>0){var tempNode=$('<div class="ap_temp">'+container.html()+"</div>");
tempNode.css({display:"inline",position:"absolute",top:-9999,left:-9999});
rootElement().append(tempNode);
var marginLeft=parseInt(container.parent().css("margin-left"))||0;
var marginRight=parseInt(container.parent().css("margin-right"))||0;
var width=tempNode.width()+marginLeft+marginRight+settings.paddingLeft+settings.paddingRight+2;
if(width%2!=0){width++;
}tempNode.remove();
return Math.min(width,viewport.width());
}return null;
};
var enableDragAndDrop=function(titlebar,popover){titlebar.css("cursor","move");
disableSelect(titlebar.get(0));
titlebar.mousedown(function(e){e.preventDefault();
disableSelect(document.body);
var offset=[e.pageX-popover.offset().left,e.pageY-popover.offset().top];
var mousemove=function(e){e.preventDefault();
popover.css({left:e.pageX-offset[0],top:e.pageY-offset[1],margin:0});
if(popover.backing){popover.backing.reposition(e.pageX-offset[0],e.pageY-offset[1]);
}};
var mouseup=function(e){popover.focus();
enableSelect(document.body);
$(document).unbind("mousemove",mousemove);
$(document).unbind("mouseup",mouseup);
};
$(document).mousemove(mousemove).mouseup(mouseup);
});
};
var disableSelect=function(e){if(e){e.onselectstart=function(e){return false;
};
e.style.MozUserSelect="none";
}};
var enableSelect=function(e){if(e){e.onselectstart=function(e){return true;
};
e.style.MozUserSelect="";
}};
var boundsOfAreaElement=function(area){area=jQuery(area);
var coords=jQuery.map(area.attr("coords").split(","),function(n){return Number(n);
});
if(area.attr("shape").match(/circle/i)){coords=[coords[0]-coords[2],coords[1]-coords[2],coords[0]+coords[2],coords[1]+coords[2]];
}var x=[],y=[];
for(var i=0;
i<coords.length;
i++){(i%2==0?x:y).push(coords[i]);
}var min=[Math.min.apply(Math,x),Math.min.apply(Math,y)];
var max=[Math.max.apply(Math,x),Math.max.apply(Math,y)];
var mapName=area.parents("map").attr("name");
var mapImg=jQuery("img[usemap=#"+mapName+"]");
var map=mapImg.offset();
map.left+=parseInt(mapImg.css("border-left-width"));
map.top+=parseInt(mapImg.css("border-top-width"));
return[map.left+min[0],map.top+min[1],map.left+max[0],map.top+max[1]];
};
$.AmazonPopover={displayPopover:displayPopover,mouseTracker:mouseTracker,updateBacking:updateBacking,support:{skinCallback:true,controlCallbacks:true}};
if(typeof amznJQ!="undefined"){amznJQ.declareAvailable("popover");
}})(amznJQ.jQuery||window.jQuery);
});

/* end popover/amzPopover.js */

/* end merged-core-js-1.2.6/core.js */

/* begin navbarJS-beacon/navbarJQ-beacon.js */
amznJQ.available("jQuery",function(){var $=jQuery;
;
window.navbar={};
(function(){function throttle(wait,func){var throttling=false;
var called=false;
function afterWait(){if(!called){throttling=false;
return;
}else{called=false;
setTimeout(afterWait,wait);
func();
}}return function(){if(throttling){called=true;
return;
}throttling=true;
setTimeout(afterWait,wait);
func();
};
}var agent=window.navbar.agent=(new function(){function contains(){var args=Array.prototype.slice.call(arguments,0);
var regex=new RegExp("("+args.join("|")+")","i");
return regex.test(navigator.userAgent);
}this.iPhone=contains("iPhone");
this.iPad=contains("iPad");
this.kindleFire=contains("Kindle Fire","Silk/");
this.android=contains("Android");
this.touch=(this.iPhone||this.iPad||this.android||this.kindleFire||!!("ontouchstart" in window)||window.navigator.msMaxTouchPoints>0||contains("\\bTouch\\b"));
this.webkit=contains("WebKit");
this.ie10=contains("MSIE 10");
this.mac=contains("Macintosh");
this.iOS=this.iPhone||this.iPad;
});
var byID=function(elemID){return document.getElementById(elemID);
},logEv=function(d,o){_navbar.logEv&&_navbar.logEv(d,o);
},nullFn=function(){},dismissTooltip=(function(){var dismissed=false;
return function(){if(!dismissed){amznJQ.declareAvailable("navDismissTooltip");
}dismissed=true;
};
})();
function TunableCallback(callback){var timeout=0;
var conditions=[];
var wrapper=function(){function execute(){for(var i=0;
i<conditions.length;
i++){if(!conditions[i]()){return;
}}callback();
}if(timeout>0){setTimeout(execute,timeout);
}else{execute();
}};
wrapper.delay=function(milliseconds){timeout=milliseconds;
return wrapper;
};
wrapper.iff=function(predicate){conditions.push(predicate);
return wrapper;
};
return wrapper;
}function Observable(name){var observers=[];
var fired=false;
var observable={};
observable.observe=function(callback){if(fired){callback();
}else{observers.push(callback);
}};
observable.trigger=function(label){if(fired){return;
}fired=true;
;
while(observers.length){observers.shift()();
}};
observable.handler=function(label){return TunableCallback(function(){observable.trigger(label);
});
};
return observable;
}var eachDescendant=function(node,func){func(node);
node=node.firstChild;
while(node){eachDescendant(node,func);
node=node.nextSibling;
}};
var onPageReady=(function(){var pageReady=Observable("Nav:onPageReady");
function windowNotLoaded(){return document.readyState!="complete";
}function atfEnabled(){return window._navbar&&window._navbar.readyOnATF;
}amznJQ.onCompletion("amznJQ.AboveTheFold",pageReady.handler("ATF").iff(windowNotLoaded).iff(atfEnabled));
amznJQ.onCompletion("amznJQ.theFold",pageReady.handler("tF").iff(windowNotLoaded).iff(atfEnabled));
amznJQ.onCompletion("amznJQ.criticalFeature",pageReady.handler("CF").iff(windowNotLoaded));
$(pageReady.handler("DOMReady+10").delay(10000).iff(windowNotLoaded));
$(window).load(pageReady.handler("Page Load").delay(100));
return pageReady.observe;
})();
$.fn.navOnOptionClick=function(callback){this.each(function(){var $this=$(this);
if((agent.mac&&agent.webkit)||agent.touch){$this.change(function(){callback.apply($this);
});
}else{var time={click:0,change:0};
function buildClickChangeHandler(primary,secondary){return function(){time[primary]=new Date().getTime();
if(time[primary]-time[secondary]<=100){callback.apply($this);
}};
}$this.click(buildClickChangeHandler("click","change")).change(buildClickChangeHandler("change","click"));
}});
};
var triggerProceedToCheckout=(function(){var observers=Observable();
window.navbar.onShowProceedToCheckout=function(callback){observers.observe(function(){var buttons=$("#nav_cart_flyout a[href~=proceedToCheckout]");
if(buttons.length>0){callback(buttons);
}});
};
return observers.trigger;
}());
var navInitJSInteraction=function(){var $=jQuery,$id=function(elemID){return $(byID(elemID)||[]);
};
var isIE6=$.browser.msie&&parseInt($.browser.version)<=6;
var areaMapper=(function(){if(!agent.kindleFire){return{disable:nullFn,enable:nullFn};
}var disabled=$([]);
return{disable:function(except){var newMaps=$("img[usemap]").filter(function(){return $(this).parents(except).length==0;
});
disabled=disabled.add(newMaps);
newMaps.each(function(){this.disabledUseMap=$(this).attr("usemap");
$(this).attr("usemap","");
});
},enable:function(){disabled.each(function(){$(this).attr("usemap",this.disabledUseMap);
});
disabled=$([]);
}};
})();
_navbar.template=(function(){var cache={};
return function(id,data){if(!cache[id]){cache[id]=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};"+"with(obj){p.push('"+$(id).html().replace(/[\r\t\n]/g," ").replace(/'(?=[^#]*#>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<#=(.+?)#>/g,"',$1,'").split("<#").join("');").split("#>").join("p.push('")+"');}return p.join('');");
}try{return cache[id](data);
}catch(e){return"";
}};
})();
if(_navbar.yourAccountPrimer){$("#nav_prefetch_yourorders").mousedown((function(){var fired=false;
return function(){if(fired){return;
}fired=true;
(new Image).src=_navbar.yourAccountPrimer;
};
})());
}function NavButton(id){this._jqId="#"+id;
var button=this;
byID(id).className=byID(id).className.replace("nav-menu-inactive","nav-menu-active");
var lastShown=0;
this.onShow=function(){lastShown=+(new Date);
dismissTooltip();
button._toggleClass(true,"nav-button-outer-open");
};
this.onHide=function(){button._toggleClass(false,"nav-button-outer-open");
};
this.registerTrigger=function(options){var params=this._defaultTriggerParams(button);
$().extend(params,options||{});
var popover=$(button._jqId).amazonPopoverTrigger(params);
if(agent.touch&&$.AmazonPopover.support.controlCallbacks){$(button._jqId).click(function(){if(popover.amznPopoverVisible()&&+(new Date)-lastShown>400){popover.amznPopoverHide();
}});
}};
this.removeTrigger=function(){$(button._jqId).removeAmazonPopoverTrigger();
};
this._toggleClass=function(state,className){if(state){$(button._jqId).addClass(className);
}else{$(button._jqId).removeClass(className);
}};
$(button._jqId).keypress(function(e){if(e.which==13&&$(button._jqId).attr("href")){window.location=$(button._jqId).attr("href");
}});
this._defaultTriggerParams=function(button){return{width:null,location:"bottom",locationAlign:"left",locationMargin:0,hoverShowDelay:agent.touch?0:250,hoverHideDelay:agent.touch?0:250,showOnHover:true,forceAlignment:true,focusOnShow:false,skin:null,onShow:button.onShow,onHide:button.onHide,showCloseButton:false,group:"navbar"};
};
}var SKIN=function(jqObject,xOffset,skinClass){var callback=function(){var navWidth=$id("nav-bar-outer").width();
var rightMargin=Math.min(30,Math.max(0,navWidth-jqObject.offset().left-jqObject.outerWidth()-xOffset)),style=rightMargin<30?' style="width: '+(rightMargin+15)+'px;"':"",classes=["nav_flyout_table"];
if(isIE6){classes.push("nav_ie6");
}if(skinClass){classes.push(skinClass);
}return'<table cellspacing="0" cellpadding="0" surround="0,'+rightMargin+',30,30" class="'+classes.join(" ")+'">'+'<tr><td class="nav_pop_tl nav_pop_h"><div class="nav_pop_lr_min"></div></td><td class="nav_pop_tc nav_pop_h"></td><td class="nav_pop_tr nav_pop_h"'+style+'><div class="nav_pop_lr_min"'+style+"></div></td></tr>"+'<tr><td class="nav_pop_cl nav_pop_v"></td><td class="nav_pop_cc ap_content"></td><td class="nav_pop_cr nav_pop_v"'+style+"></td></tr>"+'<tr><td class="nav_pop_bl nav_pop_v"></td><td class="nav_pop_bc nav_pop_h"></td><td class="nav_pop_br nav_pop_v"'+style+"></td></tr>"+"</table>";
};
return $.AmazonPopover.support&&$.AmazonPopover.support.skinCallback?callback:callback();
};
var flyoutHeightTable={};
var computeFlyoutHeight=function(id){if(id in flyoutHeightTable){return flyoutHeightTable[id];
}var elem=byID(id);
var isDeepShopAll=$(elem).parents(".nav_deep").length>0;
var height=0;
if(isDeepShopAll){height-=7;
}eachDescendant(elem,function(node){var $node;
if(node.nodeType==1){$node=$(node);
if(!isDeepShopAll){height+=$node.hasClass("nav_pop_li")?23:0;
height+=$node.hasClass("nav_divider_before")?10:0;
height+=$node.hasClass("nav_last_li")?-7:0;
height+=$node.hasClass("nav_tag")?13:0;
}else{height+=$node.hasClass("nav_pop_li")?30:0;
height+=$node.hasClass("nav_first")?-7:0;
height+=$node.hasClass("nav_divider_before")?15:0;
height+=$node.hasClass("nav_tag")?13:0;
}}});
flyoutHeightTable[id]=height;
return height;
};
var initShopByDepartments=function(){if(!$id("nav-shop-all-button").length||!$id("nav_browse_flyout").length){return;
}var mt=$.AmazonPopover.mouseTracker,ub=$.AmazonPopover.updateBacking,sbd_config=_navbar._sbd_config,subcatInited,promosInited,deferredResizeSubcat,catWidth,mtRegions=[],activeCat,wasSuperCat,subcatRect,delayedChange,priorCursor,exposeSBDData,delayImpression,delayCatImpression;
var id="nav-shop-all-button",button=new NavButton(id),jQButton=$id(id),isResponsive=_navbar.responsivegw&&!agent.touch;
var onShow=function(){_navbar._initExposeSBD().deBorder(true);
areaMapper.disable("#nav_browse_flyout");
if(!promosInited){amznJQ.available("navbarPromos",_navbar.initBrowsePromos);
promosInited=true;
}var $browse_flyout=$id("nav_browse_flyout"),$subcats=$id("nav_subcats"),$subcats_wrap=$id("nav_subcats_wrap"),$cats=$id("nav_cats_wrap"),$cat_indicator=$id("nav_cat_indicator");
if(!subcatInited){catWidth=$cats.outerWidth();
$browse_flyout.css({height:computeFlyoutHeight("nav_cats_wrap")+"px",width:catWidth+"px"});
$subcats_wrap.css({display:"block"});
subcatInited=true;
}else{$browse_flyout.css({height:computeFlyoutHeight("nav_cats_wrap")+"px"});
}var animateSubcatComplete=function(){if(deferredResizeSubcat){deferredResizeSubcat();
}deferredResizeSubcat=null;
if(agent.touch){var $video=$("video");
$video.css("visibility","hidden");
setTimeout(function(){$video.css("visibility","");
},10);
}$browse_flyout.css({overflow:"visible"});
};
var rectRelation=function(cursor,rect){var h="c",v="c";
if(cursor&&rect){if(cursor.x<rect.x1){h="l";
}else{if(cursor.x>rect.x2){h="r";
}}if(cursor.y<rect.y1){v="t";
}else{if(cursor.y>rect.y2){v="b";
}}}return v+h;
};
var notInRect=function(cursor,rect){if(rectRelation(cursor,rect)=="cc"){return false;
}return true;
};
var calcChangeDelay=function(args,rect){var delay=0,c=args.cursor,p1=args.priorCursors[0]||{},p2=args.priorCursors[1]||{};
if(c.x==p1.x&&Math.abs(c.y-p1.y)<2&&c.x>p2.x){delay=sbd_config.minor_delay;
}else{var r=rect,pts=[c,p1];
switch(rectRelation(c,r)){case"tl":pts.push({x:r.x1,y:r.y2},{x:r.x2,y:r.y1});
break;
case"bl":pts.push({x:r.x1,y:r.y1},{x:r.x2,y:r.y2});
break;
case"cl":pts.push({x:r.x1,y:r.y1},{x:r.x1,y:r.y2});
break;
default:pts.push({x:0,y:0},{x:0,y:0});
delay=-1;
}if(delay==0){var b0=(pts[2].x-pts[1].x)*(pts[3].y-pts[1].y)-(pts[3].x-pts[1].x)*(pts[2].y-pts[1].y),b1=((pts[2].x-pts[0].x)*(pts[3].y-pts[0].y)-(pts[3].x-pts[0].x)*(pts[2].y-pts[0].y))/b0,b2=((pts[3].x-pts[0].x)*(pts[1].y-pts[0].y)-(pts[1].x-pts[0].x)*(pts[3].y-pts[0].y))/b0,b3=((pts[1].x-pts[0].x)*(pts[2].y-pts[0].y)-(pts[2].x-pts[0].x)*(pts[1].y-pts[0].y))/b0;
delay=(b1>0&&b2>0&&b3>0?sbd_config.major_delay:0);
}}return delay;
};
var doCatChange=function(cat,args){var animateSubcat=!activeCat,resizeSubcat=false,$subcat=$id("nav_subcats_"+cat),$cat=$id("nav_cat_"+cat),promoID=$subcat.attr("data-nav-promo-id");
if(activeCat){$id("nav_subcats_"+activeCat).css({display:"none"});
$id("nav_cat_"+activeCat).removeClass("nav_active");
}clearTimeout(delayCatImpression);
if(promoID){var imp={"t":"sa","id":promoID};
if(_navbar.browsepromos[promoID]){imp["bp"]=1;
}delayCatImpression=window.setTimeout(function(){logEv(imp);
},750);
}$cat.addClass("nav_active");
$subcat.css({display:"block"});
$cat_indicator.css("top",$cat.position().top+parseInt($cat.css("padding-top"))+1);
var isSuperCat=$subcat.hasClass("nav_super_cat");
if(isSuperCat!=wasSuperCat){if(isSuperCat){$browse_flyout.addClass("nav_super");
}else{$browse_flyout.removeClass("nav_super");
}resizeSubcat=true;
wasSuperCat=isSuperCat;
}if(animateSubcat){deferredResizeSubcat=function(){ub("navbar");
};
$browse_flyout.animate({width:($subcats.outerWidth()+catWidth)+"px"},{duration:"fast",complete:animateSubcatComplete});
}else{if(resizeSubcat){var resizeSubcatNow=function(){$browse_flyout.css({width:($subcats.outerWidth()+catWidth)+"px"});
ub("navbar");
};
if(deferredResizeSubcat){deferredResizeSubcat=resizeSubcatNow;
}else{resizeSubcatNow();
}}}if(isResponsive&&!isIE6){$subcat.parents(".nav_exposed_skin").removeClass("nav_exposed_skin");
}$subcat.find(".nav_subcat_links").each(function(){var $this=$(this);
if($this.data("nav-linestarts-marked")){return;
}$this.data("nav-linestarts-marked",true);
var top=0;
$this.find("li").each(function(){var elem=$(this);
var thisTop=elem.offset().top;
if(Math.abs(thisTop-top)>5){elem.addClass("nav_linestart");
top=thisTop;
}});
});
var offset=$subcat.offset(),x1=offset.left,y1=offset.top-sbd_config.target_slop,x2=x1+$subcat.outerWidth(),y2=y1+$subcat.outerHeight()+sbd_config.target_slop;
return{x1:x1,y1:y1,x2:x2,y2:y2};
};
window._navbar.qaActivateCat=function(i){i=i||"0";
doCatChange(i);
activeCat=i;
};
$("#nav_cats li.nav_cat").each(function(){var match=/^nav_cat_(.+)/.exec(this.id),cat=(match?match[1]:"");
var mouseEnter=function(args){clearTimeout(delayedChange);
$id("nav_cat_"+cat).addClass("nav_hover");
if(activeCat!==cat){var changeDelay=calcChangeDelay(args,subcatRect);
if(activeCat&&changeDelay>0){var doDelayedChange=function(){clearTimeout(delayedChange);
var delayedArgs=mt.getCallbackArgs(),delayedDelay=0;
if(priorCursor&&priorCursor.x==delayedArgs.cursor.x&&priorCursor.y==delayedArgs.cursor.y){if(notInRect(delayedArgs.cursor,subcatRect)){delayedDelay=0;
}else{delayedDelay=-1;
}}else{delayedDelay=calcChangeDelay(delayedArgs,subcatRect);
}priorCursor={x:delayedArgs.cursor.x,y:delayedArgs.cursor.y};
if(delayedDelay>0){if(activeCat!==cat){delayedChange=setTimeout(doDelayedChange,delayedDelay);
}}else{if(delayedDelay>-1){subcatRect=doCatChange(cat,args);
activeCat=cat;
}}};
delayedChange=setTimeout(doDelayedChange,changeDelay);
}else{subcatRect=doCatChange(cat,args);
activeCat=cat;
}}return true;
};
var mouseLeave=function(immediately,args){$id("nav_cat_"+cat).removeClass("nav_hover");
return true;
};
var $this=$(this),offset=$this.offset(),added=mt.add([[offset.left,offset.top,$this.outerWidth(),$this.outerHeight()]],{inside:false,mouseEnter:mouseEnter,mouseLeave:mouseLeave});
mtRegions.push(added);
});
};
var onHide=function(){clearTimeout(delayedChange);
clearTimeout(delayCatImpression);
clearTimeout(delayImpression);
for(var i=0;
i<mtRegions.length;
i++){mt.remove(mtRegions[i]);
}mtRegions=[];
subcatRect=null;
subcatInited=false;
if(activeCat){$id("nav_subcats_"+activeCat).css({display:"none"});
$id("nav_cat_"+activeCat).removeClass("nav_active");
}activeCat=null;
$id("nav_cat_indicator").css({top:""});
$id("nav_browse_flyout").css({height:"",overflow:""});
areaMapper.enable();
_navbar._initExposeSBD().deBorder(false);
};
_navbar._initExposeSBD=function(){if(exposeSBDData){return exposeSBDData;
}if(!isResponsive){exposeSBDData={"ok":function(){return false;
},"deBorder":nullFn,"initDeferredShow":nullFn,"deferredShow":nullFn};
return exposeSBDData;
}var $anchor=$id("nav_exposed_anchor"),skinClass=isIE6?"":"nav_exposed_skin",skin=SKIN(jQButton,0,skinClass),$skin=$(typeof(skin)=="function"?skin():skin),$wrap=$('<div id="nav_exposed_skin"></div>').css({"top":-8,"left":jQButton.offset().left-(isIE6?27:30)}).append($skin).appendTo($anchor),$old_parent=$id("nav_browse_flyout"),$parent=$('<div id="nav_exposed_cats"></div>').appendTo($(".ap_content",$wrap)),$fade=$id("nav-shop-all-button").clone().attr({"href":"javascript:void(0)","id":""}).addClass("nav-shop-all-button nav-button-outer-open").appendTo("#nav-bar-inner").add($wrap),$roots=$id("navbar").add($anchor),$cats=$id("nav_cats_wrap"),exButton=new NavButton("nav_exposed_skin"),isExposed,firstCall=true,lastState,deferShow,deferHide,oldIE=$.browser.msie&&(!document.documentMode||document.documentMode<8);
exposeSBDData={"ok":function(){return true;
},"deBorder":function(b){if(b){$skin.addClass("nav_pop_triggered");
}else{$skin.removeClass("nav_pop_triggered");
}},"initDeferredShow":function(){if(!deferShow){deferShow=nullFn;
}},"deferredShow":function(){if(deferShow){deferShow();
deferShow=null;
}}};
var exTriggerParams={localContent:"#nav_browse_flyout",location:"top",locationAlign:"left",locationOffset:[30,(oldIE?33:32)],skin:SKIN($parent,0,skinClass),hoverShowDelay:0,onShow:function(){if(!deferHide){deferHide=nullFn;
}exButton.removeTrigger();
exButton.onShow();
onShow();
$cats.appendTo($old_parent);
},onHide:function(){$cats.appendTo($parent);
onHide();
exButton.onHide();
exButton.registerTrigger(exTriggerParams);
if(deferHide){deferHide();
}deferHide=null;
}};
_navpreload&&_navpreload._protectExposeSBD&&_navpreload._protectExposeSBD(function(expose){lastState=expose;
if(expose===isExposed){return;
}if(expose){logEv({"t":"sa","id":"res-main"});
var doShow=function(){if(lastState===false){return;
}button.removeTrigger();
$roots.addClass("nav_exposed_sbd");
if($("#nav_browse_flyout.nav_deep").length>0){$roots.addClass("nav_deep");
}$cats.appendTo($parent);
if(firstCall){if($.browser.msie){$fade.css("display","block");
}else{$fade.fadeIn(600);
}firstCall=false;
}exButton.registerTrigger(exTriggerParams);
isExposed=true;
};
if(deferShow){deferShow=doShow;
}else{doShow();
}}else{var doHide=function(){if(lastState===true){return;
}exButton.removeTrigger();
$roots.removeClass("nav_exposed_sbd");
$cats.appendTo($old_parent);
if(firstCall){$fade.css("display","block");
firstCall=false;
}button.registerTrigger(triggerParams);
isExposed=false;
};
if(deferHide){deferHide=doHide;
}else{doHide();
}}});
return exposeSBDData;
};
var triggerParams={localContent:"#nav_browse_flyout",locationAlign:"left",locationOffset:[isIE6?3:0,0],skin:SKIN(jQButton,0),onShow:function(){_navbar._initExposeSBD().initDeferredShow();
button.onShow();
delayImpression=window.setTimeout(function(){logEv({"t":"sa","id":"main"});
},750);
onShow();
},onHide:function(){onHide();
button.onHide();
_navbar._initExposeSBD().deferredShow();
}};
if(!isResponsive){button.registerTrigger(triggerParams);
}};
var initYourAccount=function(){var id="nav-your-account",jQButton=$id(id),$yaFlyout=$id("nav_your_account_flyout");
if(!jQButton.length||!$yaFlyout.length){return;
}var button=new NavButton(id),$yaSidebarWrapper=$("#nav-noti-wrapper, #csr-hcb-wrapper"),$yaSidebar=$(".nav-noti-content, .csr-hcb-content",$yaSidebarWrapper),notiInited,notiCount=$yaSidebar.attr("data-noti-count"),countDisplay=function(){return notiCount>9?"9+":notiCount;
},sidebarOffset=0,delayImpression,leftAlignedYA=$id("nav-wishlist").length||$id("nav-cart").length;
var onShowNotifications=function(){if(!notiInited&&notiCount>0){notiInited=1;
var $notiItems=$(".nav-noti-item",$yaSidebar).not("#nav-noti-empty"),cutoff=$yaFlyout.height()-25;
var hideOverflow=function(){$notiItems.each(function(){var $this=$(this);
if($this.attr("data-dismissed")){return;
}if($this.position().top+$this.outerHeight()>cutoff){$this.addClass("nav-noti-overflow");
}else{$this.removeClass("nav-noti-overflow");
}});
};
if(agent.touch){$notiItems.addClass("nav-noti-hover");
}else{$notiItems.hover(function(){$(this).addClass("nav-noti-hover");
},function(){$(this).removeClass("nav-noti-hover");
});
}hideOverflow();
$(".nav-noti-x",$yaSidebar).click(function(e){e.preventDefault();
var $this=$(this);
$.ajax({url:window._navbar.dismissNotificationUrl,type:"POST",data:{"id":$this.attr("data-noti-id")},cache:false,timeout:500});
$this.css("visibility","hidden").parent().attr("data-dismissed","1").slideUp(400,function(){var $count=$id("nav-noti-count");
if(--notiCount<=0){$id("nav-noti-empty").show();
$count.remove();
}else{$count.text(countDisplay());
}hideOverflow();
});
}).hover(function(){$(this).addClass("nav-noti-x-hover");
},function(){$(this).removeClass("nav-noti-x-hover");
});
}};
var onShow=function(){button.onShow();
onShowNotifications();
areaMapper.disable("#nav_your_account_flyout");
delayImpression=window.setTimeout(function(){var imp={"t":"ya"};
if($yaSidebar.length){if(notiCount>0){imp["noti"]=1;
}else{imp["hcb"]=1;
}}logEv(imp);
},750);
$yaSidebar.height($yaFlyout.height());
window._navbar.loadDynamicMenusConditionally();
};
var onHide=function(){clearTimeout(delayImpression);
areaMapper.enable();
button.onHide();
};
if($yaSidebarWrapper.length){if($yaSidebar.length&&$yaFlyout.length){sidebarOffset=(notiCount>0?180:229)+19;
$yaFlyout.css("margin-left",sidebarOffset).prepend($('<div id="nav_ya_sidebar_wrapper"></div>').css({"width":sidebarOffset-15,"left":-sidebarOffset}).append($yaSidebar));
if(notiCount>0){var $name=$id("nav-signin-text"),name=$.trim($name.text()),nameParts=name.match(/^(.*?)(\.*)$/);
$name.html(nameParts[1]+'<span id="nav-noti-count-position"></span>'+nameParts[2]);
var countLeft=$id("nav-noti-count-position").position().left+10,tabWidth=jQButton.outerWidth()-5,freePixels=tabWidth-countLeft,cssObj={};
if(freePixels<15||countLeft<15){cssObj.right=2;
if(freePixels>0&&freePixels<=10){$name.append(new Array(11).join("&nbsp;"));
}}else{cssObj.left=Math.round(countLeft)+1;
}$('<div id="nav-noti-count" class="nav-sprite"></div>').text(countDisplay()).css(cssObj).appendTo(jQButton);
}}}var YALocationOffsetLeft=(sidebarOffset?-sidebarOffset:(isIE6?(leftAlignedYA?3:-3):0));
button.registerTrigger({localContent:"#nav_your_account_flyout",locationAlign:leftAlignedYA?"left":"right",locationOffset:[YALocationOffsetLeft,0],skin:SKIN(jQButton,(leftAlignedYA||!isIE6)?0:7),onShow:onShow,onHide:onHide,followLink:window._navbar.yourAccountClickable&&!agent.touch});
if(_navbar.signOutText){$("#nav-item-signout").html(_navbar.signOutText);
}};
var initCart=function(){if(!$id("nav-cart").length||!$id("nav_cart_flyout").length){return;
}var id="nav-cart",button=new NavButton(id),jQButton=$id(id),delayImpression;
var onShow=function(){button.onShow();
areaMapper.disable("#nav_cart_flyout");
delayImpression=window.setTimeout(function(){logEv({"t":"cart"});
},750);
window._navbar.loadDynamicMenusConditionally();
triggerProceedToCheckout();
};
var onHide=function(){clearTimeout(delayImpression);
areaMapper.enable();
button.onHide();
};
button.registerTrigger({localContent:"#nav_cart_flyout",locationAlign:"right",locationOffset:[isIE6?-3:0,0],skin:SKIN(jQButton,isIE6?7:0),onShow:onShow,onHide:onHide,followLink:!agent.touch});
};
var initWishlist=function(){if(!$id("nav-wishlist").length||!$id("nav_wishlist_flyout").length){return;
}var id="nav-wishlist",button=new NavButton(id),jQButton=$id(id),flyout="#nav_wishlist_flyout",ul=".nav_pop_ul",delayImpression;
var onShow=function(){button.onShow();
areaMapper.disable("#nav_wishlist_flyout");
delayImpression=window.setTimeout(function(){logEv({"t":"wishlist"});
},750);
window._navbar.loadDynamicMenusConditionally();
var $flyout=$(flyout),width=$flyout.outerWidth();
$flyout.css("width",width).find(ul).css("width",width).addClass("nav_pop_ul_wrap");
};
var onHide=function(){clearTimeout(delayImpression);
$(flyout).css("width","").find(ul).css("width","").removeClass("nav_pop_ul_wrap");
areaMapper.enable();
button.onHide();
};
button.registerTrigger({localContent:"#nav_wishlist_flyout",locationAlign:"right",locationOffset:[isIE6?-3:0,0],skin:SKIN(jQButton,isIE6?7:0),onShow:onShow,onHide:onHide,followLink:!agent.touch});
};
var initPrimeTooltip=function(){if(!$id("nav-prime-ttt").length||!$id("nav-prime-tooltip").length){return;
}var id="nav-prime-ttt",button=new NavButton(id),jQButton=$id(id),delayImpression,large=$("#navbar").hasClass("nav-logo-large"),msie=$.browser.msie;
var onShow=function(){button.onShow();
areaMapper.disable("#nav-prime-tooltip");
delayImpression=window.setTimeout(function(){logEv({"t":"prime-tt"});
},750);
};
var onHide=function(){clearTimeout(delayImpression);
areaMapper.enable();
button.onHide();
};
jQButton.css("padding-right",large?"21px":"25px");
button.registerTrigger({localContent:"#nav-prime-tooltip",width:null,location:"right",locationAlign:"top",locationOffset:[(msie?-3:0),(large?-35:-26)],showOnHover:true,hoverShowDelay:agent.touch?0:250,hoverHideDelay:agent.touch?0:250,onShow:onShow,onHide:onHide,showCloseButton:false,zIndex:201,skin:'<div class="nav-tt-skin'+(large?" nav-logo-large":"")+'">'+'<div class="nav-tt-border'+(msie?"":" nav-tt-box-shadow")+'">'+'<div class="ap_content"></div>'+"</div>"+'<div class="nav-tt-beak"></div>'+'<div class="nav-tt-beak-2"></div>'+"</div>",followLink:!agent.touch});
};
var initPrime=function(){if(!$id("nav-your-prime").length||!$id("nav-prime-menu").length){return;
}var id="nav-your-prime",button=new NavButton(id),jQButton=$id(id),delayImpression;
var onShow=function(){button.onShow();
areaMapper.disable("#nav-prime-menu");
delayImpression=window.setTimeout(function(){logEv({"t":"prime"});
},750);
};
var onHide=function(){clearTimeout(delayImpression);
areaMapper.enable();
button.onHide();
};
button.registerTrigger({localContent:"#nav-prime-menu",locationAlign:"right",locationOffset:[isIE6?-3:0,0],skin:SKIN(jQButton,isIE6?7:0),onShow:onShow,onHide:onHide,followLink:!agent.touch});
};
var navbarAPIError="no error";
window.navbar.error=function(){return navbarAPIError;
};
window.navbar.update=function(navDataObject){var $=jQuery;
var err="navbar.update() error: ";
if(navDataObject instanceof Object){window._navbar.unlockDynamicMenus();
var closures=new Array();
var cleanupClosures=new Array();
if(navDataObject.catsubnav){try{var navCatSubnav=$("#nav-subnav");
if(navCatSubnav.length>0){var catSubnavChanges=0;
var newCatSubnav=[];
var category=navDataObject.catsubnav.category;
if(category&&category.type=="link"){var navCatItem=$("li.nav-category-button:first",navCatSubnav);
if(navCatItem.length==0){throw"category-1";
}var cDatum=category.data;
if(!cDatum.href||!cDatum.text){throw"category-2";
}var newCat=navCatItem.clone();
var aCat=$("a:first",newCat);
if(aCat.length==0){throw"category-3";
}aCat.attr("href",cDatum.href).html(cDatum.text);
newCatSubnav.push(newCat.get(0));
catSubnavChanges+=1;
}var subnav=navDataObject.catsubnav.subnav;
if(subnav&&subnav.type=="linkSequence"){var navSubItem=$("li.nav-subnav-item",navCatSubnav).slice(-1);
if(navSubItem.length==0){throw"subnav-1";
}for(var i=0;
i<subnav.data.length;
i++){var datum=subnav.data[i];
if(!datum.href||!datum.text){throw"subnav-2";
}var newItem=navSubItem.clone();
if(datum.flag){newItem.addClass("nav-subnav-item-active");
}var aElem=$("a:first",newItem);
if(aElem.length==0){throw"subnav-3";
}aElem.attr("href",datum.href).html(datum.text);
newCatSubnav.push(newItem.get(0));
}if(newCatSubnav.length>1){catSubnavChanges+=1;
}}var navbarDiv=$("#navbar");
if(navbarDiv.length==0){throw"catsubnav-1";
}if(catSubnavChanges==2){closures.push(function(){navCatSubnav.empty().append(newCatSubnav).css("display","");
navbarDiv.addClass("nav-subnav");
});
}else{if(catSubnavChanges==0){closures.push(function(){navbarDiv.removeClass("nav-subnav");
navCatSubnav.css("display","none");
});
}}}}catch(e){navbarAPIError=err+e;
return false;
}}if(navDataObject.cart){try{var cart=navDataObject.cart;
if(cart.type=="countPlusLD"||cart.type=="count"){if(!cart.data){throw"cart-1";
}var newCount=cart.data.count+"";
if(!newCount.match(/^(|0|[1-9][0-9]*|99\+)$/)){throw"cart-2";
}var cartCounts=$("#nav-cart-count, #nav_cart_flyout .nav-cart-count");
if(cartCounts.length>0){closures.push(function(){var cartFullClass="nav-cart-0";
if(newCount=="99+"){cartFullClass="nav-cart-100";
}else{if(newCount>99){newCount="99+";
cartFullClass="nav-cart-100";
}else{if(newCount>19){cartFullClass="nav-cart-20";
}else{if(newCount>9){cartFullClass="nav-cart-10";
}}}}cartCounts.removeClass("nav-cart-0 nav-cart-10 nav-cart-20 nav-cart-100").addClass(cartFullClass).html(newCount);
if(newCount==0&&byID("nav-cart-zero")){$("#nav-cart-one, #nav-cart-many").hide();
$("#nav-cart-zero").show();
}else{if(newCount==1){$("#nav-cart-zero, #nav-cart-many").hide();
$("#nav-cart-one").show();
}else{$("#nav-cart-zero, #nav-cart-one").hide();
$("#nav-cart-many").show();
}}});
}var LDData=cart.data.LDData;
if(LDData){closures.push(function(){_navbar._lightningDealsData=LDData;
});
}}}catch(e){navbarAPIError=err+e;
return false;
}}if(navDataObject.searchbar){try{var searchbar=navDataObject.searchbar;
if(searchbar.type=="searchbar"){if(!searchbar.data){throw"searchbar-1";
}var options=searchbar.data.options;
if(!options||options.length==0){throw"searchbar-2";
}var dropdown=$("#searchDropdownBox");
if(dropdown.length==0){dropdown=$("#navSearchDropdown select:first");
}if(dropdown.length==0){throw"searchbar-3";
}closures.push(function(){dropdown.blur().empty();
for(var i=0;
i<options.length;
i++){var attrs=options[i];
var _display=attrs._display;
delete attrs._display;
$("<option></option>").html(_display).attr(attrs).appendTo(dropdown);
}amznJQ.available("popover",function(){amznJQ.available("navbarInline",function(){_navbar.refreshDropDownFacade();
});
});
});
}}catch(e){navbarAPIError=err+e;
return false;
}}if(navDataObject.primeBadge){try{var isPrime=navDataObject.primeBadge.isPrime;
if(isPrime.type=="boolean"){var navbarDiv=$("#navbar");
if(navbarDiv.length==0){throw"primeBadge-1";
}closures.push(function(){if(isPrime.data){navbarDiv.addClass("nav-prime");
}else{navbarDiv.removeClass("nav-prime");
}});
}var homeUrl=navDataObject.primeBadge.homeUrl;
if(homeUrl.type=="html"){var navLogoTag=$("#nav-logo");
if(navLogoTag.length==0){throw"primeBadge-2";
}if(homeUrl.data){closures.push(function(){navLogoTag.attr("href",homeUrl.data);
});
}}}catch(e){navbarAPIError=err+e;
return false;
}}if(navDataObject.swmSlot){try{var swmContent=navDataObject.swmSlot.swmContent;
if(swmContent&&swmContent.type=="html"){var navSwmSlotDiv=$("#navSwmSlot");
if(navSwmSlotDiv.length==0){throw"swmContent-1";
}if(swmContent.data){closures.push(function(){navSwmSlotDiv.html(swmContent.data);
});
}}var swmHeight=navDataObject.swmSlot.height;
if(swmHeight&&swmHeight.type=="html"){var navWelcomeRowDiv=$("#welcomeRowTable");
if(navWelcomeRowDiv.length==0){throw"swmSlotHeight-1";
}closures.push(function(){navWelcomeRowDiv.css("height",swmHeight.data||"");
var sizeRegex=/-(small|large)$/;
var navbar=$("#navbar");
$(navbar.attr("class").split(/\s+/)).filter(function(){return sizeRegex.test(this);
}).each(function(){var isLarge=parseInt(swmHeight.data||0,10)>40;
var newClass=this.replace(sizeRegex,isLarge?"-large":"-small");
navbar.removeClass(this).addClass(newClass);
});
});
}var swmStyle=navDataObject.swmSlot.style;
if(swmStyle&&swmStyle.type=="html"){var navAdBackgroundStyleDiv=$("#nav-ad-background-style");
if(navAdBackgroundStyleDiv.length==0){throw"swmSlotStyle-1";
}closures.push(function(){navAdBackgroundStyleDiv.attr("style",swmStyle.data||"");
});
}}catch(e){navbarAPIError=err+e;
return false;
}}if(navDataObject.signInText){try{var customerName=navDataObject.signInText.customerName;
var greetingText=navDataObject.signInText.greetingText;
if(customerName.type=="html"&&greetingText.type){var navSignInTitleSpan=$("#nav-signin-title");
if(navSignInTitleSpan.length==0){throw"signInText-1";
}var template=navSignInTitleSpan.attr("data-template");
if(template&&greetingText.data&&customerName.data){template=template.replace("{helloText}",greetingText.data);
template=template.replace("{signInText}",customerName.data);
closures.push(function(){navSignInTitleSpan.html(template);
});
}}}catch(e){navbarAPIError=err+e;
return false;
}}if(navDataObject.yourAccountLink){try{var yourAccountLink=navDataObject.yourAccountLink;
if(yourAccountLink.type=="html"){var navYourAccountTag=$("#nav-your-account");
if(navYourAccountTag.length==0){throw"your-account-1";
}if(yourAccountLink.data){closures.push(function(){navYourAccountTag.attr("href",yourAccountLink.data);
});
}}}catch(e){navbarAPIError=err+e;
return false;
}}if(navDataObject.crossShop){try{var yourAmazonText=navDataObject.crossShop;
if(yourAmazonText.type=="html"){var navYourAmazonTag=$("#nav-your-amazon");
if(navYourAmazonTag.length==0){throw"yourAmazonText-1";
}closures.push(function(){if(yourAmazonText.data&&(navYourAmazonTag.text()!=yourAmazonText.data)){navYourAmazonTag.html(yourAmazonText.data);
}});
}cleanupClosures.push(function(){$("#nav-cross-shop-links").css("display","");
});
}catch(e){navbarAPIError=err+e;
return false;
}}if(closures.length>0){try{for(var i=0;
i<closures.length;
i++){closures[i]();
}}catch(e){navbarAPIError=err+e;
return false;
}finally{for(var i=0;
i<cleanupClosures.length;
i++){cleanupClosures[i]();
}}return true;
}else{navbarAPIError=err+(navDataObject.error||"unknown error");
}}else{navbarAPIError=err+"parameter not an Object";
}return false;
};
window.navbar.setCartCount=function(newCartCount){return window.navbar.update({"cart":{"type":"count","data":{"count":newCartCount}}});
};
window.navbar.getLightningDealsData=function(){return _navbar._lightningDealsData||{};
};
window.navbar.overrideCartButtonClick=function(clickHandler){$("#nav-cart, #nav-cart-menu-button").click(clickHandler);
};
_navbar.initBrowsePromos=function(){if(_navbar.browsepromos){$("#nav_browse_flyout .nav_browse_subcat").each(function(){var $this=$(this),promoID=$this.attr("data-nav-promo-id");
if(promoID){var data=_navbar.browsepromos[promoID];
if(data){if(data.promoType){if(data.promoType=="wide"){$this.addClass("nav_super_cat");
}var mapID="nav_imgmap_"+promoID,vOffset=isIE6?15:14,bottom=parseInt(data.vertOffset)-vOffset,right=parseInt(data.horizOffset),ie6Hack=isIE6&&/\.png$/i.test(data.image),imgSrc=ie6Hack?$id("nav_trans_pixel").attr("src"):data.image,$img=$("<img>").attr({src:imgSrc,alt:data.alt,useMap:"#"+mapID}).addClass("nav_browse_promo").css({bottom:bottom,right:right,width:data.width,height:data.height});
$this.prepend($img);
if(ie6Hack){$img.get(0).style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+data.image+"',sizingMethod='scale')";
}}else{$this.prepend(_navbar.template("#nav-tpl-asin-promo",data));
}}}});
}};
if(!(agent.ie10&&agent.touch)){initPrimeTooltip();
initShopByDepartments();
initYourAccount();
initWishlist();
initPrime();
initCart();
}(function(){var ajaxLoaded=!(window._navbar.dynamicMenus),mouseHookTriggered=!(window._navbar.dynamicMenus);
window._navbar.unlockDynamicMenus=function(){ajaxLoaded=false;
mouseHookTriggered=false;
};
var ajaxLock=false,wishlistParent=$id("nav_wishlist_flyout"),cartParent=$id("nav_cart_flyout"),bothParents=$(wishlistParent).add(cartParent),wishlistContent=$("#nav_wishlist_flyout .nav_dynamic"),cartContent=$("#nav_cart_flyout .nav_dynamic"),preloadStarted;
function allowDynamicMenuRetry(){setTimeout(function(){mouseHookTriggered=false;
},5000);
}function loadDynamicMenus(){if(ajaxLock||ajaxLoaded){return;
}ajaxLock=true;
if(_navpreload&&_navpreload._menuCallback){_navpreload._menuCallback();
}bothParents.addClass("nav-ajax-loading").removeClass("nav-ajax-error nav-empty");
bothParents.find(".nav-ajax-success").hide();
$.AmazonPopover.updateBacking("navbar");
$.ajax({url:window._navbar.dynamicMenuUrl,dataType:"json",cache:false,timeout:10000,complete:function(){bothParents.removeClass("nav-ajax-loading");
$.AmazonPopover.updateBacking("navbar");
ajaxLock=false;
},error:function(){bothParents.addClass("nav-ajax-error");
allowDynamicMenuRetry();
},success:function(data){data=$.extend({cartDataStatus:false,cartCount:0,cart:[],wishlistDataStatus:false,wishlist:[]},data);
if(data.cartDataStatus){navbar.setCartCount(data.cartCount);
}function updateDynamicMenu(status,dataList,parentElem,templateID,contentElem){if(status){if(dataList.length==0){parentElem.addClass("nav-empty").removeClass("nav-full");
}else{parentElem.addClass("nav-full").removeClass("nav-empty");
}contentElem.html(_navbar.template(templateID,data));
parentElem.find(".nav-ajax-success").show();
}else{parentElem.addClass("nav-ajax-error");
}}updateDynamicMenu(data.cartDataStatus,data.cart,cartParent,"#nav-tpl-cart",cartContent);
updateDynamicMenu(data.wishlistDataStatus,data.wishlist,wishlistParent,"#nav-tpl-wishlist",wishlistContent);
if(data.cartDataStatus&&data.wishlistDataStatus){ajaxLoaded=true;
}else{allowDynamicMenuRetry();
}}});
}window._navbar.loadDynamicMenusConditionally=function(){if(!mouseHookTriggered){loadDynamicMenus();
}mouseHookTriggered=true;
if(!preloadStarted){preloadStarted=true;
if(window._navbar["prefetch"]){window._navbar.prefetch();
}}return true;
};
function attachTriggers(){var accumLeft=[],accumRight=[],accumTop=[],accumBottom=[];
$("#nav-wishlist, #nav-cart").each(function(i,elem){elem=$(elem);
var pos=elem.offset();
accumLeft.push(pos.left);
accumTop.push(pos.top);
accumRight.push(pos.left+elem.width());
accumBottom.push(pos.top+elem.height());
});
var proximity=_navbar._ajaxProximity||[0,0,0,0];
var left=Math.min.apply(Math,accumLeft)-proximity[3],top=Math.min.apply(Math,accumTop)-proximity[0],width=Math.max.apply(Math,accumRight)+proximity[1]-left,height=Math.max.apply(Math,accumBottom)+proximity[2]-top;
$.AmazonPopover.mouseTracker.add([[left,top,width,height]],{inside:false,mouseEnter:window._navbar.loadDynamicMenusConditionally,mouseLeave:function(){return true;
}});
bothParents.find(".nav-try-again").click(loadDynamicMenus);
}if(window._navbar.dynamicMenuUrl){onPageReady(attachTriggers);
}})();
amznJQ.declareAvailable("navbarJS-beacon");
amznJQ.declareAvailable("navbarJS-jQuery");
amznJQ.declareAvailable("navbarJSInteraction");
};
var navInitSearchDropdown=function(){var $=jQuery,$id=function(elemID){return $(byID(elemID)||[]);
},dropdownNode=byID("searchDropdownBox"),dropdown=$(dropdownNode),facade=$id("nav-search-in"),facadeContent=byID("nav-search-in-content"),searchBox=$id("twotabsearchtextbox"),searchBoxParent=(function(elem){if(elem.hasClass("nav-searchfield-width")){return elem;
}else{if(elem.parent().size()>0){return arguments.callee(elem.parent());
}else{return searchBox.parent();
}}})(searchBox),facadePrefilled=(function(){return(facadeContent.getAttribute&&facadeContent.getAttribute("data-value"))||$(facadeContent).attr("data-value");
})(),state={isHover:false,isFocus:false,searchFocus:false,searchHover:false},previousVal=null;
window._navbar.refreshDropDownFacade=function(){};
if($.browser.msie){if(parseFloat($.browser.version)<7){amznJQ.declareAvailable("navbarSearchDropDown");
return;
}facade.addClass("ie");
}function tweakDropdownWidth(){var facadeWidth=facade.width();
if(dropdown.width()<facadeWidth){dropdown.width(facadeWidth);
}}function updateActiveState(){if(state.isFocus){facade.addClass("focus").removeClass("active");
var redraw=document.createElement("div");
facade.append(redraw);
setTimeout(function(){redraw.parentNode.removeChild(redraw);
},10);
}else{if(state.isHover||state.searchFocus||state.searchHover){facade.addClass("active").removeClass("focus");
}else{facade.removeClass("active focus");
}}}function getSelected(){var len=dropdownNode.children.length;
for(var i=0;
i<len;
i++){if(dropdownNode.children[i].selected){return $(dropdownNode.children[i]);
}}return dropdown.children("option:selected");
}function redrawSearchBox(){searchBox.css("padding-right",parseInt(searchBox.css("padding-right"),10)?0:1);
}function useAbbrDropdown(){if(!window._navbar.abbrDropdown){return false;
}var facadeWidth=$(facadeContent).width();
if(facadeWidth>195){return true;
}if(facadeWidth>100&&searchBoxParent.outerWidth()<=400){return true;
}return false;
}function updateFacadeWidth(){$(facade).add(facadeContent).css({"width":"auto"});
$(facadeContent).css({"overflow":"visible"});
if(useAbbrDropdown()){$(facadeContent).css({"width":100,"overflow":"hidden"});
}setTimeout(function(){searchBoxParent.css({"padding-left":facade.width()});
redrawSearchBox();
tweakDropdownWidth();
},1);
}function updateFacade(){var selected=getSelected(),selectedVal=selected.val();
if(selectedVal!=previousVal){var display=(previousVal||(selectedVal!=facadePrefilled))?selected.html():facadeContent.innerHTML;
previousVal=selectedVal;
logEv({"t":"sd","id":selectedVal.split("=")[1]});
if(facadeContent.innerHTML!=display){facadeContent.innerHTML=display;
updateFacadeWidth();
}}updateActiveState();
}function focusSearchBox(){if(iss){state["isFocus"]=false;
iss.focus();
}}function keypressHandler(e){if(e.which==13){focusSearchBox();
}if(e.which!=9&&e.which!=16){updateFacade();
}}window._navbar.refreshDropDownFacade=updateFacade;
function buildCallback(property,value){return function(){state[property]=value;
updateActiveState();
};
}facade.get(0).className+=" nav-facade-active";
updateFacade();
dropdown.change(updateFacade).keyup(keypressHandler).focus(buildCallback("isFocus",true)).blur(buildCallback("isFocus",false)).hover(buildCallback("isHover",true),buildCallback("isHover",false)).focus(dismissTooltip).navOnOptionClick(function(){focusSearchBox();
updateFacade();
});
$(window).resize(throttle(150,updateFacadeWidth));
onPageReady(function(){if($(facadeContent).outerWidth(true)-facade.outerWidth()>=4||useAbbrDropdown()){updateFacadeWidth();
}tweakDropdownWidth();
dropdown.css({"top":Math.max(0,(facade.outerHeight()-dropdown.outerHeight())/2)});
});
amznJQ.available("search-js-autocomplete",function(){iss.keydown(function(e){setTimeout(function(){keypressHandler(e);
},10);
});
iss.keydown(dismissTooltip);
iss.onFocus(buildCallback("searchFocus",true));
iss.onBlur(buildCallback("searchFocus",false));
iss.onBlur(updateFacade);
if(iss.onSearchBoxHover){iss.onSearchBoxHover(buildCallback("searchHover",true),buildCallback("searchHover",false));
}});
amznJQ.declareAvailable("navbarSearchDropDown");
};
amznJQ.available("popover",function(){amznJQ.available("navbarInline",function(){amznJQ.available("navbarBTF",navInitJSInteraction);
amznJQ.available("navbarBTFLite",navInitSearchDropdown);
});
});
})();
amznJQ.available("navbarPromosContent",function(){window.navbar.issPromotions=function(){if(!_navbar.issPromos||_navbar.issPromos.length==0){return null;
}return _navbar.issPromos;
};
window._navbar.loggedImpressions={};
window.navbar.logImpression=function(feature){if(_navbar.loggedImpressions[feature]){_navbar.loggedImpressions[feature]++;
}else{_navbar.loggedImpressions[feature]=1;
}};
amznJQ.declareAvailable("navbarPromos");
});
amznJQ.available("search-js-autocomplete",function(){amznJQ.available("navbarInline",function(){window.navbar.initAutoFocus=function(){var doc=document,first=false;
if(window.navbar.agent.touch){return;
}function getSelection(){if(window.getSelection){return window.getSelection();
}else{if(document.selection){return document.selection.createRange().text;
}else{return"";
}}}function canFocus(){return $(doc).scrollTop()<=iss.offset().top&&$(doc.activeElement).filter("input,select,textarea").size()<1&&getSelection()=="";
}function isAugmented(e){return e.altKey||e.ctrlKey||e.metaKey;
}function isAugmentor(key){return $.inArray(key,[0,16,20,17,18,224,91,93])>=0;
}var maybeControls=[8,32,37,38,39,40];
function isAlwaysControl(key){if($.inArray(key,maybeControls)>=0){return false;
}return(key<=46&&key!=9&&key!=13)||(key>90&&key<94)||(key>111&&key<146);
}function isMaybeControl(key){return isAlwaysControl(key)||($.inArray(key,maybeControls)>=0);
}if(canFocus()){iss.focus();
first=true;
}iss.keydown(function(e){var key=e.keyCode;
if(!isAugmentor(key)){if((first&&isMaybeControl(key))||(iss.keyword()==""&&isAlwaysControl(key))){iss.blur();
}first=false;
}});
$(doc).keydown(function(e){if(canFocus()&&!isMaybeControl(e.keyCode)&&e.keyCode!=9&&e.keyCode!=13&&!isAugmentor(e)&&!isAugmented(e)){iss.focus();
}});
};
amznJQ.declareAvailable("navbarJS-autofocus");
});
});
window.navbar.unHideSWM=function(){amznJQ.available("jQuery",function(){var $=jQuery,$h=$("#navHiddenSwm"),s=_navbar._swmStyleData||{};
if($h.length){$("#navbar").removeClass("nav-logo-small nav-logo-large").addClass("nav-logo-"+(parseInt(s.height||0)>40?"large":"small"));
$("#welcomeRowTable").css("height",s.height||"");
var $swm=$("#navSwmSlot");
$swm.parent().attr("style",s.style||"");
$swm.children().css("display","none");
$h.css("display","");
}});
};
window.navbar.exposeSBD=function(expose){amznJQ.available("navbarJSInteraction",function(){if(_navbar._initExposeSBD&&_navbar._initExposeSBD().ok()&&_navpreload&&_navpreload._protectExposeSBD){_navpreload._protectExposeSBD(expose);
}});
};
amznJQ.available("navbarInline",function(){window.navbar.navDimensions=function(){var elem=jQuery("#navbar");
var result=elem.offset();
result.height=elem.height();
result.bottom=result.top+result.height;
return result;
};
});
amznJQ.declareAvailable("navbarJSLoaded");
});

/* end navbarJS-beacon/navbarJQ-beacon.js */

/* begin search-js-autocomplete/autocomplete.js */
amznJQ.available("jQuery",function(){amznJQ.available("popover",function(){(function($){$.fn.amznFlyoutIntent=function(arg){var defaults={getTarget:function(el){return $(this).children('*[position="absolute"]').eq(0);
},triggerAxis:"y",majorDelay:300,minorDelay:100,targetSlopY:50,targetSlopX:50,cursorSlopBase:25,cursorSlopHeight:50,mtRegions:[]},nameSp="amznFlyoutIntent",mt=$.AmazonPopover.mouseTracker,getRect=function(el,slopX,slopY){var off=el.offset(),tl={x:off.left-(slopX||0),y:off.top-(slopY||0)},br={x:tl.x+el.outerWidth()+((slopX||0)*2),y:tl.y+el.outerHeight()+((slopY||0)*2)};
return[tl,br];
},triBC=function(tri){var t0=tri[0],t1=tri[1],t2=tri[2];
return(t1.x-t0.x)*(t2.y-t0.y)-(t2.x-t0.x)*(t1.y-t0.y);
},isInTri=function(p,tri){var b0=1/triBC(tri),t0=tri[0],t1=tri[1],t2=tri[2];
return(triBC([t1,t2,p])*b0)>0&&(triBC([t2,t0,p])*b0)>0&&(triBC([t0,t1,p])*b0)>0;
},clamp=function(p,r){var r0=r[0],r1=r[1];
return{x:p.x<r0.x?-1:p.x>r1.x?1:0,y:p.y<r0.y?-1:p.y>r1.y?1:0};
},isInRect=function(p,rect){var c=clamp(p,rect);
return c.x==0&&c.y==0;
},sel=function(a,b,a0,a1,b0,b1,d){return a<0?a0:a>0?a1:b<0?b0:b>0?b1:d;
},getExtremePoints=function(p,rect){var c=clamp(p,rect),cx=c.x,cy=c.y,r0=rect[0],r1=rect[1],r0x=r0.x,r0y=r0.y,r1x=r1.x,r1y=r1.y;
return[{x:sel(cy,cx,r0x,r1x,r0x,r1x,0),y:sel(cx,cy,r1y,r0y,r0y,r1y,0)},{x:sel(cy,cx,r1x,r0x,r0x,r1x,0),y:sel(cx,cy,r0y,r1y,r0y,r1y,0)}];
},isInCone=function(cursor,p1,cfg){var slopRect=$.extend(true,[],cfg.slopRect),sy=cfg.targetSlopY,sx=cfg.targetSlopX,c=clamp(p1,cfg.targetRect),cx=c.x,cy=c.y,sh=cfg.cursorSlopHeight,sb=cfg.cursorSlopBase,p=$.extend({},p1),q=$.extend({},p1),exP;
if(cy==0){slopRect[cx<0?0:1].x-=sy*cx;
}else{if(cx==0){slopRect[cy<0?0:1].y-=sb*cy;
}}if(cfg.triggerAxis==="x"){p.y=q.y-=sb*cy;
p.x-=sh;
q.x+=sh;
}else{q.x=p.x-=sb*cx;
p.y-=sh*cx;
q.y+=sh*cx;
}exP=getExtremePoints(p1,slopRect);
return isInTri(cursor,[p1,exP[0],exP[1]])||isInTri(cursor,[p1,exP[0],p])||isInTri(cursor,[p1,exP[1],q]);
},calcChangeDelay=function(c,rect,p1,p2,cfg){var delay=0;
p1=p1||{};
p2=p2||{};
if(isInRect(c,rect)){delay=-1;
}else{if(isInCone(c,p1,cfg)){delay=cfg.majorDelay;
}else{if(Math.abs(c.x-p1.x)<10&&Math.abs(c.y-p1.y)<10&&isInCone(c,p2,cfg)){delay=cfg.minorDelay;
}}}return delay;
},changeTrigger=function(el,cfg){cfg.triggerEl&&cfg.onMouseOut&&cfg.onMouseOut.call(cfg.triggerEl.get(0));
cfg.onMouseOver.call(el.get(0));
if(!cfg.targets){cfg.targets={};
}var tgt=cfg.targets[el];
if(!tgt){cfg.targets[el]=tgt={triggerEl:$(el)};
tgt.targetEl=cfg.getTarget.call(el.get(0));
tgt.targetRect=getRect(tgt.targetEl);
tgt.slopRect=getRect(tgt.targetEl,cfg.targetSlopY,cfg.targetSlopX);
}cfg.triggerEl=tgt.triggerEl;
cfg.targetEl=tgt.targetEl;
cfg.targetRect=tgt.targetRect;
cfg.slopRect=tgt.slopRect;
},m={destroy:function(){var cfg=this.data(nameSp),i;
if(cfg){clearTimeout(cfg.timeoutId);
for(i=0;
i<cfg.mtRegions.length;
i++){mt.remove(cfg.mtRegions[i]);
}this.removeData(nameSp);
}},init:function(opts){var cfg=this.data(nameSp);
if(!cfg){cfg=$.extend(defaults,opts);
this.data(nameSp,cfg);
}return this.each(function(){var $this=$(this),off=$this.offset(),mouseLeave=function(immediately,args){cfg.onMouseLeave&&this.el&&cfg.onMouseLeave.call(this.el.get(0));
return true;
},mouseEnter=function(args){clearTimeout(cfg.timeoutId);
var trigger,changeDelay,doDelayedChange;
cfg.onMouseEnter&&this.el&&cfg.onMouseEnter.call(this.el.get(0));
if(cfg.triggerEl&&this.el&&cfg.triggerEl!==this.el){trigger=this.el;
changeDelay=cfg.targetRect?calcChangeDelay(args.cursor,cfg.targetRect,args.priorCursors[0],args.priorCursors[1],cfg):-1;
if(cfg.triggerEl&&changeDelay>0){doDelayedChange=function(){var delayedArgs=mt.getCallbackArgs(),nextDelay=0;
clearTimeout(cfg.timeoutId);
if(cfg.priorCursor&&cfg.priorCursor.x===delayedArgs.cursor.x&&cfg.priorCursor.y===delayedArgs.cursor.y){nextDelay=isInRect(delayedArgs.cursor,cfg.targetRect)?-1:0;
}else{nextDelay=calcChangeDelay(delayedArgs.cursor,cfg.targetRect,delayedArgs.priorCursors[0],delayedArgs.priorCursors[1],cfg);
}cfg.priorCursor={x:delayedArgs.cursor.x,y:delayedArgs.cursor.y};
if(nextDelay>0&&cfg.triggerEl.get(0)!==trigger.get(0)){cfg.timeoutId=setTimeout(function(){doDelayedChange.call(trigger);
},nextDelay);
}else{if(nextDelay>-1){if(isInRect(delayedArgs.cursor,getRect(trigger))){changeTrigger(trigger,cfg);
}else{cfg.onMouseOut&&cfg.onMouseOut.call(trigger.get(0));
}}}};
cfg.timeoutId=setTimeout(doDelayedChange,changeDelay);
}else{changeTrigger(this.el,cfg);
}}else{changeTrigger(this.el,cfg);
}return true;
};
cfg.mtRegions.push(mt.add([[off.left,off.top,$this.outerWidth(),$this.outerHeight()]],{inside:false,mouseEnter:mouseEnter,mouseLeave:mouseLeave,el:$this}));
});
}};
if(m[arg]){return m[arg].apply(this,Array.prototype.slice.call(arguments,1));
}if(typeof arg==="object"||!arg){return m.init.apply(this,arguments);
}return this;
};
}(jQuery));
amznJQ.declareAvailable("amznFlyoutIntent");
});
});
amznJQ.available("jQuery",function(){amznJQ.available("amznFlyoutIntent",function(){(function(window,undefined){var $=window.jQuery,merchRE=/^me=/,refre=/(ref=[-\w]+)/,ltrimre=/^\s+/,spaceNormRe=/\s+/g,ddre=/_dd_/,ddaliasre=/(dd_[a-z]{3,4})(_|$)[\w]*/,deptre=/\{department\}/g,slashre=/\+/g,aliasre=/search-alias\s*=\s*([\w-]+)/,nodere=/node\s*=\s*([\d]+)/,noissre=/ref=nb_sb_noss/,dcs="#ddCrtSel",sdpc="searchDropdown_pop_conn",tostr=Object.prototype.toString,ddBox,metrics={isEnabled:typeof uet=="function"&&typeof uex=="function",init:"iss-init-pc",completionsRequest0:"iss-c0-pc",completionsRequestSample:"iss-cs-pc",sample:2,noFocusTag:"iss-on-time",focusTag:"iss-late"};
$.isArray=$.isArray||function(o){return tostr.call(o)==="[object Array]";
};
var SS=function(sb,pe,displayHtml,handlers){var node,noOp=function(){},defaults={afterCreate:noOp,beforeShow:noOp,afterShow:noOp,beforeHide:noOp,beforeHtmlChange:noOp,afterHtmlChange:noOp,onWindowResize:noOp},events=$.extend({},defaults,handlers);
function create(){node=$(displayHtml).appendTo(pe||sb.parent());
events.afterCreate.call(node);
$(window).resize(function(e){events.onWindowResize.call(node,e);
});
return node;
}function get(){return node||create();
}function setHtml(h){events.beforeHtmlChange.call(get(),h);
get().html(h);
events.afterHtmlChange.call(get(),h);
return this;
}this.getNode=get;
this.html=setHtml;
this.visible=function(){return get().is(":visible");
};
this.hide=function(){events.beforeHide.call(get());
get().hide();
setHtml("");
return this;
};
this.show=function(){events.beforeShow.call(get());
get().show();
events.afterShow.call(get());
return this;
};
};
var IAC=function(sb,pe,iac,newDesign){var sbPlaceHolder,sbPlaceHolderDiv,sbNode,sbDiv,iacNode,iacDiv,widthDiv,canShowIAC=true,iacType=0;
function get(){return iacNode||create();
}function create(){var p=sb.pos(true),d=sb.size(true),sbPlaceHolderCss={top:p.top,left:p.left,width:"100%",border:"2px inset"},sbPlaceHolderCssOverride={background:"none repeat scroll 0 0 transparent",color:"black","font-family":"arial,sans-serif","font-size":"12pt",height:"23px",margin:"7px 0 0",outline:"0 none",padding:0,border:"0 none"},iacNodeCss={left:p.left,width:d.width,top:p.top,"z-index":1,color:"#999",position:"absolute","background-color":"#FFF"},iacNodeCssOverride={left:p.left+5,width:d.width-5,border:"0 none","font-family":"arial,sans-serif","font-size":"12pt",height:"23px",margin:"7px 0 0",outline:"0 none",padding:0};
sbPlaceHolder=$("<input id='sbPlaceHolder' class='searchSelect' readOnly='true'/>").css(sbPlaceHolderCss).css(newDesign?sbPlaceHolderCssOverride:{}).appendTo(pe||sb.parent());
sbPlaceHolderDiv=sbPlaceHolder.get(0);
sbNode=$("#twotabsearchtextbox").css({position:"absolute",background:"none repeat scroll 0 0 transparent","z-index":5,width:d.width});
sbDiv=sbNode.get(0);
iacNode=$("<input id='inline_auto_complete' class='searchSelect' readOnly='true'/>").css(iacNodeCss).css(newDesign?iacNodeCssOverride:{}).appendTo(pe||sb.parent());
iacDiv=iacNode.get(0);
setInterval(adjust,200);
sbNode.keydown(keyDown);
if(newDesign){widthDiv=sb.parent().parent();
}return iacNode;
}function adjust(){var p=sb.pos(),d=sb.size(),adjustment=0,w=d.width;
if(newDesign){adjustment=5;
w=widthDiv.width()-adjustment;
}sbNode.css({left:p.left+adjustment,top:p.top,width:w});
iacNode.css({left:p.left+adjustment,top:p.top,width:w});
}function keyDown(event){var value=get().val();
get().val("");
var key=event.keyCode;
switch(key){case 8:case 37:case 46:if(value&&value.length>0){event.preventDefault();
}iacType=0;
canShowIAC=false;
break;
case 32:iacType=0;
canShowIAC=false;
break;
case 13:if(iac==2){break;
}case 39:if(value&&value.length>0){sb.keyword(value);
iacType=key==13?1:2;
}canShowIAC=true;
break;
case 16:case 17:case 18:case 20:case 229:get().val(value);
default:iacType=0;
canShowIAC=true;
break;
}}this.val=function(value){if(value!==undefined){get().val(value);
}return get().val();
};
this.clear=function(){get().val("");
};
this.type=function(){return iacType;
};
this.displayable=function(showIAC){if(showIAC!==undefined){canShowIAC=showIAC;
}return canShowIAC;
};
this.touch=function(){get();
return true;
};
};
var SB=function(sb,h){var curText,curSel,latestUserInput,navIssAttach,sbPlaceHolder;
init();
function init(){if(metrics.isEnabled){ue.tag(sb.get(0)===document.activeElement?metrics.focusTag:metrics.noFocusTag);
}sb.keydown(keyDown).keyup(keyUp).keypress(keyPress).blur(blurHandler).focus(focusHandler).click(clickHandler);
latestUserInput=curText=kw();
h.newDesign&&(navIssAttach=$("#nav-iss-attach"));
}function kw(k){if(k!==undefined){curText=curSel=k;
sb.val(k);
}return sb.val().replace(ltrimre,"").replace(spaceNormRe," ");
}function input(k){if(k!==undefined){latestUserInput=k;
}return latestUserInput;
}function keyDown(e){var key=e.keyCode,d=key==38?-1:key==40?1:0;
if(h.opt.twoPane===1){return h.twoPaneArrowKeyHandler(e);
}if(d){h.adjust(d);
if(kw()!=""){e.preventDefault();
}}}function keyUp(e){var key=e.keyCode;
switch(key){case 13:h.hide();
break;
case 27:return h.dismiss();
case 37:case 38:case 39:case 40:break;
default:update(true);
break;
}}function keyPress(e){var key=e.keyCode;
switch(key){case 13:return h.submitEnabled();
default:h.keyPress();
break;
}}function update(dontCheckCurSel){var val=kw();
if(val!=curText&&(dontCheckCurSel||val!=curSel)){curText=val;
input(val);
h.change(val);
}}function focusHandler(e){}function blurHandler(e){h.dismiss();
}function clickHandler(e){h.click(kw());
}function getSbPlaceHolder(){if(!sbPlaceHolder){sbPlaceHolder=$("#sbPlaceHolder");
}return sbPlaceHolder;
}this.keyword=function(k){return kw(k);
};
this.userInput=function(k){return input(k);
};
this.size=function(nonIAC){var e=sb;
if(h.newDesign){e=navIssAttach;
}else{if(!nonIAC&&h.iac&&h.checkIAC()){e=getSbPlaceHolder();
}}return{width:e.outerWidth(),height:e.outerHeight()};
};
this.pos=function(nonIAC){var e=sb;
if(h.newDesign){e=navIssAttach;
}else{if(!nonIAC&&h.iac&&h.checkIAC()){e=getSbPlaceHolder();
}}return e.position();
};
this.offset=function(nonIAC){var e=sb;
if(!nonIAC&&h.iac&&h.checkIAC()){e=getSbPlaceHolder();
}return e.offset();
};
this.parent=function(){return sb.parent();
};
this.hasFocus=function(){return sb.get(0)===document.activeElement;
};
this.update=update;
this.blur=function(e){sb.blur(e);
};
this.focus=function(e){var val=sb.val();
sb.focus(e).val("").val(val);
};
this.keydown=function(h){sb.keydown(h);
};
this.click=function(h){sb.click(h);
};
this.onFocus=function(h){sb.focus(h);
};
this.onBlur=function(h){sb.blur(h);
};
};
var AC=function(opts){var version=1,opt={},names,values,crtSel=-1,crtXcatSel=-1,suggestionList=[],twoPaneSuggestionsList=[],curSize=0,hideDelayTimerId=null,timer=null,maxCategorySuggestions=4,suggestRequest=null,first=-1,defaultDropDownVal,insertedDropDownVal,delayedDOMUpdate=false,staticContent,searchBox,keystroke,sugHandler,inlineAutoComplete,searchSuggest,activityAllowed=true,promoList=[],suggType="sugg",newDesign=$("#navbar").hasClass("nav-beacon"),defaults={sb:"#twotabsearchtextbox",form:"#navbar form[name='site-search']",dd:"#searchDropdownBox",cid:"amazon-search-ui",action:"",sugPrefix:"issDiv",sugText:"Search suggestions",fb:0,xcat:0,twoPane:0,dupElim:0,maxSuggestions:10},lastKeyPressTime,timeToFirstSuggestion=0,searchAliasFrom,defaultTimeout=100,reqCounter=0;
opts&&init(opts);
function init(opts){$.extend(opt,defaults,opts);
newDesign=opt.isNavInline&&newDesign;
var src=opt.src;
staticContent=$.isArray(src),resizeToken=null;
lookup(opt,"sb");
if(!opt.sb){return;
}searchBox=new SB(opt.sb,{adjust:move,twoPaneArrowKeyHandler:twoPaneArrowKeyHandler,hide:hideSuggestions,dismiss:dismissSuggestions,change:(staticContent?update:delayUpdate),submitEnabled:submitEnabled,keyPress:keyPress,click:clickHandler,newDesign:newDesign,iac:opt.iac,checkIAC:checkIAC,opt:opt});
lookup(opt,"pe");
if(opt.iac){inlineAutoComplete=new IAC(searchBox,opt.pe,opt.iac,newDesign);
}if(opt.twoPane==false){searchSuggest=new SS(searchBox,opt.pe,'<div id="srch_sggst"/>',{afterCreate:resizeHandler,onWindowResize:resizeHandler,beforeShow:resizeHandler});
}else{searchSuggest=new SS(searchBox,opt.pe,'<div id="srch_sggst" class="two-pane" style="display:none"/>',{afterCreate:twoPaneSetPosition,beforeHtmlChange:twoPaneDestroyFlyout,beforeShow:twoPaneSetPosition,afterShow:function(h){twoPaneSetPosition.call(this);
twoPaneSetXcatPosition.call(this);
twoPaneBindFlyout.call(this);
},onWindowResize:function(){var $this=this;
resize=function(){twoPaneDestroyFlyout.call($this);
twoPaneBindFlyout.call($this);
resizeToken=null;
};
window.clearTimeout(resizeToken);
resizeToken=window.setTimeout(resize,100);
twoPaneSetPosition.call($this);
twoPaneSetXcatPosition.call($this);
}});
}lookup(opt,"form");
lookup(opt,"valInput");
lookup(opt,"dd");
lookup(opt,"submit");
ddBox=opt.dd;
opt.protocol=opt.protocol||window.parent.document.location.protocol;
if(staticContent){names=src[0];
values=src[1];
opt.sb.removeAttr("style");
}else{}if(opt.submit){disable("disabled");
opt.submitImgDef=opt.submit.attr("src");
opt.submitToggle=opt.submitImgDef&&opt.submitImg;
}if(opt.ime){window.setInterval(function(){searchBox.update();
},20);
}this.version=version;
amznJQ.available("navbarPromos",function(){promoList=window.navbar.issPromotions(3);
});
}function initStatic(sb,form,valInput,submit,submitImg,names,values,noMatch,ime,multiword,dummy0){init({form:form,ime:ime,multiword:multiword,noMatch:noMatch,sb:sb,src:[names,values],submit:submit,submitImg:submitImg,valInput:valInput});
}function initDynamic(sb,form,dd,service,mkt,aliases,handler,deptText,sugText,sc,dummy0,hilite){init({aliases:aliases,dd:dd,deptText:deptText,form:form,handler:handler,hilite:hilite,ime:(mkt==6||mkt==3240),mkt:mkt,sb:sb,sc:sc,src:service,sugText:sugText});
}function lookup(h,k,n){if(n=h[k]){n=$(n);
if(n&&n.length){h[k]=n;
return n;
}}delete h[k];
}function disable(d){opt.submit.attr("disabled",d);
}function move(n){if(curSize<=0){return;
}try{unhighlightCurrentSuggestion();
if(n>0&&crtSel>=curSize-1){crtSel=-1;
}else{if(n<0&&crtSel<0){crtSel=curSize-1;
}else{crtSel+=n;
}}highlightCurrentSuggestion(true);
}catch(e){}}function wrap(x,min,max){return x>max?min:(x<min?max:x);
}function twoPaneArrowKeyHandler(e){var key=e.keyCode,list=twoPaneSuggestionsList,mainLength=list.length,xcatLength=list[crtSel]&&list[crtSel].xcat?list[crtSel].xcat.length:0,ssNode=searchSuggest.getNode(),n,crtSelId,xcatSelId,firstId=opt.sugPrefix+0;
if(e.ctrlKey||e.altKey||e.shiftKey){return;
}switch(key){case 38:case 40:n=key===38?-1:1;
if(crtSel>-1&&crtXcatSel>=0){crtXcatSel=wrap(crtXcatSel+n,0,xcatLength-1);
}else{crtSel=wrap(crtSel+n,-1,mainLength-1);
}break;
case 37:case 39:if(crtSel<=-1){return;
}if(key===39&&crtXcatSel<=-1&&xcatLength>0){crtXcatSel=0;
}else{if(key===37){crtXcatSel=-1;
}}break;
default:return;
}crtSelId=opt.sugPrefix+crtSel;
xcatSelId=opt.sugPrefix+crtSel+"-"+crtXcatSel;
ssNode.find("#"+opt.sugPrefix+"0").removeClass("xcat-arrow-hint");
ssNode.find(".main-suggestion").each(function(i,el){var e=$(el);
if(el.id===crtSelId){e.addClass("suggest_link_over");
ssNode.find("#xcatPanel-"+i).show().find(".xcat-suggestion").each(function(i,el){var e=$(el);
if(el.id!==xcatSelId){e.removeClass("suggest_link_over");
}else{e.addClass("suggest_link_over");
}});
}else{if(crtSel<=-1&&el.id===firstId){e.removeClass("suggest_link_over");
ssNode.find("#"+opt.sugPrefix+"0").addClass("xcat-arrow-hint");
ssNode.find("#xcatPanel-0").show().find(".xcat-suggestion").removeClass("suggest_link_over");
}else{e.removeClass("suggest_link_over");
ssNode.find("#xcatPanel-"+i).hide();
}}});
updateCrtSuggestion();
e.preventDefault();
return false;
}function clickHandler(kw){if(!kw.length){displayPromotions();
}}function hideSuggestions(){!opt.ime&&hideSuggestionsDiv();
}function dismissSuggestions(){if(searchSuggest.visible()){hideDelayTimerId=setTimeout(function(){return(function(){hideDelayTimerId=null;
hideSuggestionsDiv();
});
}(),300);
crtSel=-1;
if(suggType=="sugg"){updateCrtSuggestion();
}return false;
}return true;
}function update(kw){suggestionList=[];
twoPaneSuggestionsList=[];
if(!kw.length){displayPromotions();
if(inlineAutoComplete){inlineAutoComplete.clear();
}}else{first=-1;
if(opt.multiword){findSeq();
}else{findBin();
}curSize=suggestionList.length;
displaySuggestions(kw);
checkForExactMatch();
checkForManualOverride();
}timer=null;
crtSel=-1;
crtXcatSel=-1;
}function delayUpdate(kw){var then=now();
if(timer){clearTimeout(timer);
timer=null;
}timer=setTimeout(function(){if(inlineAutoComplete){inlineAutoComplete.clear();
}return(function(){if(!kw||!kw.length){displayPromotions();
}else{searchJSONSuggest();
}timer=null;
crtSel=-1;
crtXcatSel=-1;
});
}(),defaultTimeout);
}function submitEnabled(){if(suggType=="promo"&&crtSel>-1){document.location.href=promoList[crtSel].href;
return false;
}var s=opt.submit;
return !s||!s.attr("disabled");
}function keyPress(key){keystroke&&keystroke(key);
}function bindSubmit(handler){opt.form.submit(handler);
}function bindKeypress(handler){keystroke=handler;
}function bindSuggest(handler){sugHandler=handler;
}function normalize(s){if(opt.normalize){return opt.normalize(s);
}else{return s.toLowerCase();
}}function findBin(){var low=0,high=names.length-1,mid=-1,dataPrefix="",crtPrefix=normalize(keyword()),len=crtPrefix.length;
while(low<=high){mid=Math.floor((low+high)/2);
dataPrefix=normalize(names[mid]).substr(0,len);
if(dataPrefix<crtPrefix){low=mid+1;
}else{high=mid-1;
if(dataPrefix==crtPrefix){first=mid;
}}}if(first!=-1){var i=first,n;
do{suggestionList.push({keyword:names[i],i:i});
++i;
}while(suggestionList.length<opt.maxSuggestions&&(n=names[i])&&!normalize(n).indexOf(crtPrefix));
}}function findSeq(){var crtPrefix=normalize(keyword()),rexp=new RegExp("(^|(?:\\s))"+crtPrefix,"i"),i=0,len=names.length,n;
for(;
i<len&&suggestionList.length<opt.maxSuggestions;
i++){n=names[i];
if(normalize(n).match(rexp)){suggestionList.push({keyword:n,i:i});
if(first==-1){first=i;
}}}}function checkForExactMatch(){var state="disabled";
if(curSize){var sg=normalize(suggestionList[0].keyword),kw=normalize(keyword());
if(sg.length==kw.length&&!getPrefixPos(sg,kw)){updateForm(first);
state="";
}}disable(state);
}function checkForManualOverride(){if(opt.manualOverride&&!curSize){var kw=keyword();
var url=opt.manualOverride(kw);
if(url&&url.length){updateWholeForm(url);
disable("");
}}}function displayPromotions(){if(!newDesign||!promoList||promoList.length==0){hideSuggestionsDiv();
hideNoMatches();
return;
}curSize=promoList.length;
suggType="promo";
searchSuggest.html("");
hideNoMatches();
searchSuggest.show();
h='<ul class="promo_list">';
for(i=0;
i<curSize;
i++){p=promoList[i];
h+='<li id="'+opt.sugPrefix+i+'" onclick="document.location.href=\''+p.href+"'\">";
h+='<div class="promo_image" style="background-image: url(\''+p.image+"');\"></div>";
h+='<div class="promo_cat">'+p.category+"</div>";
h+='<div class="promo_title">'+p.title+"</div>";
h+="</li>";
}h+="</ul>";
searchSuggest.html(h);
window.navbar.logImpression("iss");
for(i=0;
i<curSize;
++i){$("#"+opt.sugPrefix+i).mouseover(suggestOver).mouseout(suggestOut);
}}function displaySuggestions(crtPrefix){var sugDivId,lineText,line,sPrefix=opt.sugPrefix,prefix="#"+sPrefix,h="";
suggType="sugg";
searchSuggest.html("");
if(curSize>0){hideNoMatches();
searchSuggest.show();
if(!staticContent&&!newDesign){h+='<div id="sugdivhdr" align="right"> '+opt.sugText+"</div>";
}if(opt.iac&&inlineAutoComplete.displayable()){var sg=normalize(suggestionList[0].keyword),originalKw=opt.sb.val(),normalizedKw=normalize(keyword());
if(normalizedKw.length>0&&sg!=normalizedKw&&sg.indexOf(normalizedKw)==0){inlineAutoComplete.val(originalKw+sg.substring(normalizedKw.length));
}}}else{showNoMatches();
}for(i=0;
i<curSize;
i++){line=suggestionList[i];
sugDivId=sPrefix+i;
lineText=line.alias?getFormattedCategoryLine(line,crtPrefix):getFormattedSuggestionLine(line,crtPrefix);
h+='<div id="'+sugDivId+'" class="suggest_link">'+lineText+"</div>";
}if(curSize>0&&!newDesign){h+='<div id="sugdivhdr2" align="right">&nbsp;</div>';
}h&&searchSuggest.html(h);
if(timeToFirstSuggestion==0&&suggestionList.length>0){recordTimeToFirstSuggestion();
}if(ddBox){defaultDropDownVal=ddBox.val();
}searchAliasFrom=extractSearchAlias(defaultDropDownVal);
for(i=0;
i<curSize;
++i){$(prefix+i).mouseover(suggestOver).mouseout(suggestOut).click(setSearchByIndex);
}}function displayTwoPaneSuggestions(crtPrefix){var len=crtPrefix.length,i,j,k,sg,isIe6=$.browser.msie&&$.browser.version=="6.0",suppressFormatting=(start==-1&&!opt.hilite),targetOffset,sb=[],a=function(){$.each(arguments,function(i,t){sb.push(t);
});
},sgLen=twoPaneSuggestionsList.length,xcatLen,maxXcatLen=0,ssNode;
$($.find(".main-suggestion:first")).amznFlyoutIntent("destroy");
if(curSize>0){hideNoMatches();
if(opt.iac&&inlineAutoComplete.displayable()){var sg=normalize(twoPaneSuggestionsList[0].keyword),originalKw=opt.sb.val(),normalizedKw=normalize(keyword());
if(normalizedKw.length>0&&sg!=normalizedKw&&sg.indexOf(normalizedKw)==0){inlineAutoComplete.val(originalKw+sg.substring(normalizedKw.length));
}}a('<table id="two-pane-table" class="',isIe6?"nav_ie6":"nav_exposed_skin",'" cellpadding="0" cellspacing="0">',"<tr>",'<td class="iss_pop_tl nav_pop_h"><div class="nav_pop_lr_min"></div></td>','<td style="background-color: #fff;" colspan="2"></td>','<td class="iss_pop_tr nav_pop_h"></td>',"</tr>","<tr>",'<td class="nav_pop_cl nav_pop_v"><div class="nav_pop_lr_min"></div></td>','<td class="main-suggestions">');
for(i=0;
i<sgLen;
i++){a('<div id="',opt.sugPrefix,i,'" class="suggest_link main-suggestion');
if(i===0){a(" xcat-arrow-hint");
}a('"><span>');
sg=twoPaneSuggestionsList[i];
xcatLen=sg.xcat.length;
if(xcatLen){a('<span class="nav-sprite nav-cat-indicator xcat-arrow"></span>');
if(maxXcatLen<xcatLen){maxXcatLen=xcatLen;
}}a(getFormattedSuggestionLine(sg,crtPrefix),"</span></div>");
}for(i=0;
i<(maxXcatLen-sgLen);
i++){a('<div class="iss-spacer-row">&nbsp;</div>');
}a('</td><td class="xcat-suggestions">');
for(i=0;
i<sgLen;
i++){sg=twoPaneSuggestionsList[i];
a('<div id="xcatPanel-',i,'" class="xcat-panel"');
if(i>0){a(' style="display:none"');
}a(">");
for(j=0;
j<sg.xcat.length;
j++){a('<div id="',opt.sugPrefix,i,"-",j,'" class="suggest_link xcat-suggestion',j===0?" xcat-suggestion-hint":"",'">',sg.xcat[j].categoryName,"</div>");
}a("</div>");
}a("</td>",'<td class="nav_pop_cr nav_pop_v"></td>',"</tr>","<tr>",'<td class="nav_pop_bl nav_pop_v"></td>','<td colspan="2" class="nav_pop_bc nav_pop_h"></td>','<td class="nav_pop_br nav_pop_v"></td>',"</tr>","</table>");
}else{showNoMatches();
}searchSuggest.html(sb.join(""));
searchSuggest.show();
if(timeToFirstSuggestion==0&&suggestionList.length>0){recordTimeToFirstSuggestion();
}if(ddBox){defaultDropDownVal=ddBox.val();
}searchAliasFrom=extractSearchAlias(defaultDropDownVal);
ssNode=searchSuggest.getNode();
ssNode.find(".main-suggestion").bind("click",twoPaneSearchByIndex);
ssNode.find(".xcat-suggestion").bind("click",twoPaneSearchByIndex).bind("mouseover",twoPaneSuggestOver).bind("mouseout",twoPaneXcatSuggestOut);
}function recordTimeToFirstSuggestion(){var timeNow=now();
timeToFirstSuggestion=(timeNow-lastKeyPressTime)+defaultTimeout;
}function showNoMatches(){if(opt.noMatch){var nmDiv=$("#"+opt.noMatch);
searchSuggest.html("");
searchSuggest.getNode().append(nmDiv.clone().attr("class","suggest_link suggest_nm").css({"display":"block"}));
searchSuggest.show();
opt.submitToggle&&opt.submit.attr("src",opt.submitImg);
}else{hideSuggestionsDiv();
}}function hideNoMatches(){if(opt.noMatch){$("#"+opt.noMatch).hide();
opt.submitToggle&&opt.submit.attr("src",opt.submitImgDef);
}}function setSearchByIndex(){var divId=this.id;
crtSel=parseInt(divId.substr(6),10);
updateCrtSuggestion();
searchSuggest.hide();
if(opt.iac){inlineAutoComplete.clear();
}if(!delayedDOMUpdate){opt.form.submit();
}else{window.setTimeout(function(){opt.form.submit();
},10);
}}function twoPaneSearchByIndex(event){var divId=this.id,prefixLen=opt.sugPrefix.length;
crtSel=parseInt(divId.substr(prefixLen),10);
crtXcatSel=(divId.length===prefixLen+1)?-1:parseInt(divId.substr(prefixLen+2,1),10);
event&&event.stopPropagation();
updateCrtSuggestion();
$($.find(".main-suggestion:first")).amznFlyoutIntent("destroy");
searchSuggest.hide();
if(opt.iac){inlineAutoComplete.clear();
}if(!delayedDOMUpdate){opt.form.submit();
}else{window.setTimeout(function(){opt.form.submit();
},10);
}}function updateCrtSuggestion(){var alias,categoryName,sg;
if(crtSel>=0){sg=opt.twoPane===1?(crtXcatSel>=0?twoPaneSuggestionsList[crtSel].xcat[crtXcatSel]:twoPaneSuggestionsList[crtSel]):suggestionList[crtSel];
keyword(sg.keyword);
alias=sg.alias;
categoryName=sg.categoryName;
}if(staticContent){if(crtSel>=0){updateForm(sg.i);
disable("");
}else{checkForExactMatch();
checkForManualOverride();
}}else{updateCategoryDropDown(alias,categoryName);
setDynamicSearch(sg);
}}opt.form&&opt.form.submit(function(){var currentKeyword=normalize(keyword()),refTag="ref=nb_sb_noss",i=0;
var iacType=opt.iac?inlineAutoComplete.type():0;
if(iacType){refTag="ref=nb_sb_iac_"+iacType;
}else{if(crtSel>-1){return;
}if(suggestionList.length>0){refTag="ref=nb_sb_noss_2";
while(i<suggestionList.length){if(normalize(suggestionList[i].keyword)==currentKeyword){refTag="ref=nb_sb_noss_1";
break;
}i++;
}}}opt.form.attr("action",opt.form.attr("action").replace(refre,refTag));
});
function setDynamicSearch(sg){var prefixElems=$("#issprefix");
if(sg){var issMode,kw=searchBox.userInput();
if(isFallbackSuggestion(sg)){issMode="ss_fb";
}else{if(sg.alias){issMode="ss_c";
}else{if(opt.sc&&isSpellCorrection(sg)){issMode="ss_sc";
}else{issMode="ss_i";
}}}setSearchFormReftag(opt.form,null,issMode,sg,kw.length);
kw=kw+","+searchAliasFrom+","+timeToFirstSuggestion;
if(prefixElems.length){prefixElems.attr("value",kw);
}else{input(opt.form,"issprefix","sprefix",kw);
}}else{prefixElems.remove();
}}function twoPaneSuggestOver(){var len=opt.sugPrefix.length,id=this.id,crtSelId="#"+opt.sugPrefix+crtSel,xcatSelId,nextSel=parseInt(id.substr(len,1),10);
this.style.cursor="pointer";
$(".xcat-panel").hide();
if(nextSel!==crtSel){$(crtSelId).removeClass("suggest_link_over");
}$("#"+opt.sugPrefix+"0").removeClass("xcat-arrow-hint");
crtSel=nextSel;
crtXcatSel=(id.length===len+1)?-1:parseInt(id.substr(len+2,1),10);
crtSelId="#"+opt.sugPrefix+crtSel;
$(crtSelId).addClass("suggest_link_over");
$("#xcatPanel-"+crtSel).show();
if(crtXcatSel>-1){$("#"+opt.sugPrefix+crtSel+"-"+crtXcatSel).addClass("suggest_link_over");
}}function twoPaneSuggestOut(){$(this).removeClass("suggest_link_over");
}function twoPaneXcatSuggestOut(){unhighlightSuggestion($(this));
}function resizeHandler(){var p=searchBox.pos(),d=searchBox.size();
this.css({width:d.width,top:p.top+d.height,left:p.left});
}function twoPaneBindFlyout(){searchSuggest.getNode().find(".main-suggestion").amznFlyoutIntent({onMouseOver:twoPaneSuggestOver,getTarget:function(){return $("#two-pane-table .xcat-suggestions:first");
}});
}function twoPaneDestroyFlyout(){var mainSgs=searchSuggest.getNode().find(".main-suggestion").get(0);
if(mainSgs){$(mainSgs).amznFlyoutIntent("destroy");
}}function twoPaneSetPosition(){var p=searchBox.pos(),d=searchBox.size(),minWidth=649;
this.css({width:Math.max(d.width+72,minWidth),top:p.top+d.height+1,left:p.left-40});
}function twoPaneSetXcatPosition(){var maxH=this.find(".main-suggestions:first").height(),th=this.find("#"+opt.sugPrefix+"0").outerHeight(),sgLen=twoPaneSuggestionsList.length,i,h,xb,xh,off;
for(i=1;
i<sgLen;
i++){h=this.find("#"+opt.sugPrefix+i).outerHeight();
xb=this.find("#xcatPanel-"+i);
off=th;
if(xb){xb=$(xb);
xh=xb.outerHeight();
if(off+xh>maxH){off=maxH-xh;
}xb.css({"margin-top":off});
}th+=h;
}}function suggestOver(event){this.style.cursor=newDesign==true?"pointer":"default";
unhighlightCurrentSuggestion();
crtSel=parseInt(this.id.substr(opt.sugPrefix.length),10);
highlightCurrentSuggestion(false);
}function suggestOut(el,event){unhighlightSuggestion($(this));
crtSel=-1;
}function highlightSuggestion(suggestion){suggestion.addClass("suggest_link_over");
}function unhighlightSuggestion(suggestion){suggestion.removeClass("suggest_link_over");
}function highlightCurrentSuggestion(updateSearchBox){if(suggType=="sugg"){updateSearchBox&&updateCrtSuggestion();
}highlightSuggestion($("#"+opt.sugPrefix+crtSel));
}function unhighlightCurrentSuggestion(){unhighlightSuggestion($("#"+opt.sugPrefix+crtSel));
}function updateCategoryDropDown(alias,categoryName){var dd=ddBox,toRemove,val;
if(!dd){return;
}val=alias?("search-alias="+alias):defaultDropDownVal;
toRemove=(val==insertedDropDownVal||defaultDropDownVal==insertedDropDownVal)?null:insertedDropDownVal;
if(alias){var sel=findOption(dd,val);
insertedDropDownVal=null;
if(!sel.length){dd.append(option(val,categoryName));
insertedDropDownVal=val;
}}try{delayedDOMUpdate=false;
$(dcs).length&&changeDropdownSelection(val,categoryName,true);
dd.val(val);
}catch(e){delayedDOMUpdate=true;
}toRemove&&findOption(dd,toRemove).remove();
}function getPrefixPos(str,substr){if(opt.multiword){return getPrefixPosMultiWord(str,substr);
}return normalize(str).indexOf(normalize(substr));
}function getPrefixPosMultiWord(str,substr){var p=normalize(str).search(new RegExp("(^|(?:\\s))"+normalize(substr),"i"));
return p<=0?p:p+1;
}function getFormattedSuggestionLine(curSuggestionLine,crtPrefix){var kw=curSuggestionLine.keyword,start=getPrefixPos(kw,crtPrefix),len,suppressFormatting=(start==-1&&!opt.hilite);
if(!suppressFormatting){len=crtPrefix.length;
if(!opt.hilite){kw=kw.substr(0,start)+bold(kw.substr(start,len))+kw.substr(start+len);
}else{if(curSuggestionLine.sc){kw=bold(kw);
}else{kw=kw.substr(0,len)+bold(kw.substr(start+len));
}}}return kw;
}function getFormattedCategoryLine(categoryLine,crtPrefix){return opt.deptText?getFormattedSuggestionLine(categoryLine,crtPrefix)+' <span class="suggest_category">'+opt.deptText.replace(deptre,categoryLine.categoryName)+"</span>":categoryLine.categoryName;
}function hideSuggestionsDiv(){if(suggType=="sugg"&&suggestRequest){suggestRequest.cleanup();
suggestRequest=null;
}curSize=0;
$($.find(".main-suggestion:first")).amznFlyoutIntent("destroy");
searchSuggest.hide();
crtSel=-1;
crtXcatSel=-1;
}function updateWholeForm(v){var fp=getFormParams(v);
cleanForm();
populateForm(fp);
}function updateForm(index){var v=values[index];
if(opt.valInput&&opt.valInput.length){opt.valInput.attr("value",v);
}else{updateWholeForm(v||location.href);
}}function getFormParams(url){var splitUrl=url.split("?"),query=splitUrl.length>1?splitUrl[1]:undefined,params=query?query.split("&"):[],i=params.length,pair;
while(i-->0){pair=params[i].split("=");
params[i]={name:pair[0],value:pair[1].replace(slashre," ")};
}return{uri:splitUrl[0],formParams:params};
}function cleanForm(){opt.form.find(".frmDynamic").remove();
}function populateForm(formData){opt.form.attr("action",formData.uri);
for(var i=0;
i<formData.formParams.length;
i++){var param=formData.formParams[i];
input(opt.form,"frmDynamic",param.name,unescape(decodeURIComponent(param.value)),1);
}}function keyword(k){return searchBox.keyword(k);
}function searchAlias(alias){if(alias){changeDropdownSelection(alias);
}else{return extractSearchAlias(ddBox.attr("value"));
}}function extractSearchAlias(alias){var aliasName=alias.match(aliasre);
return aliasName?aliasName[1]:null;
}function searchNode(){var nodeName=ddBox.attr("value").match(nodere);
return nodeName?nodeName[1]:null;
}function suggestions(){return suggestionList;
}function supportedSearchAlias(alias){var a=opt.aliases;
return a&&arrayIndexOf(a,alias)>=0;
}function isSpellCorrection(sg){return sg&&sg.sc?true:false;
}function isFallbackSuggestion(sg){return(sg&&sg.source&&sg.source[0]=="fb");
}function combineSuggestions(crtSuggestions,extraData){var xcatSuggestions,m,n=crtSuggestions.length,combinedList=[],i=0,j=0,sg,cs,s;
si=0;
while(combinedList.length<opt.maxSuggestions&&i<n){sg={keyword:crtSuggestions[i],sc:isSpellCorrection(extraData[i]),conf:extraData[i].conf,sgIndex:i};
combinedList.push(sg);
xcatSuggestions=(extraData&&extraData.length?extraData[i].nodes:[])||[];
m=xcatSuggestions.length;
if(m){s=extraData[i].source;
if(s&&s.length){for(si=0;
si<s.length;
si++){if(s[si]==="fb"){combinedList.pop();
break;
}}}j=0;
while(j<m&&j<maxCategorySuggestions&&combinedList.length<opt.maxSuggestions){cs=xcatSuggestions[j];
sg={keyword:crtSuggestions[i],sc:isSpellCorrection(extraData[i]),source:extraData[i].source,alias:cs.alias,categoryName:cs.name,conf:extraData[i].conf,sgIndex:i,xcatIndex:j};
combinedList.push(sg);
++j;
}}++i;
}curSize=combinedList.length;
return combinedList;
}function build2PaneSuggestions(crtSuggestions,extraData){var xcatSuggestions,xcat=[],m,n=crtSuggestions.length,combinedList=[],i=0,j=0,sg,cs,s,si=0;
while(combinedList.length<opt.maxSuggestions&&i<n){xcatSuggestions=(extraData&&extraData.length?extraData[i].nodes:[])||[];
xcat=[];
xcat.push({keyword:crtSuggestions[i],sc:isSpellCorrection(extraData[i]),source:extraData[i].source||"c",alias:opt.dd.val().match(aliasre)[1],categoryName:opt.dd.children().filter(":selected").text(),conf:extraData[i].conf,sgIndex:i,xcatIndex:0});
m=xcatSuggestions.length;
if(m){j=0;
while(j<m&&j<opt.maxSuggestions){cs=xcatSuggestions[j];
sg={keyword:crtSuggestions[i],sc:isSpellCorrection(extraData[i]),source:extraData[i].source||"c",alias:cs.alias,categoryName:cs.name,conf:extraData[i].conf,sgIndex:i,xcatIndex:j+1};
xcat.push(sg);
++j;
}}combinedList.push({keyword:crtSuggestions[i],sc:isSpellCorrection(extraData[i]),conf:extraData[i].conf,sgIndex:i,xcat:xcat});
++i;
}curSize=combinedList.length;
return combinedList;
}function searchJSONSuggest(){lastKeyPressTime=now();
suggestRequest&&suggestRequest.cleanup();
if(!activityAllowed){return;
}if(!searchBox.hasFocus()){return;
}var alias=searchAlias(),kw=keyword(),suggestUrl=[],a=function(){$.each(arguments,function(i,t){suggestUrl.push(t);
});
},m=reqCounter===0?metrics.completionsRequest0:(reqCounter===metrics.sample?metrics.completionsRequestSample:null);
if(!supportedSearchAlias(alias)){hideSuggestionsDiv();
return;
}a(opt.protocol,"//",opt.src,"?","method=completion","&q=",encodeURIComponent(kw),"&search-alias=",alias,"&client=",opt.cid,"&mkt=",opt.mkt,"&fb=",opt.fb,"&xcat=",opt.xcat,"&x=updateISSCompletion");
if(opt.sc){a("&sc=1");
}if(opt.nonPrefix){a("&non-prefix=1");
}if(opt.dupElim>0){a("&dr=",opt.dupElim);
}if(opt.conf){a("&conf=1");
}if(suggestRequest){suggestRequest.cleanup();
}suggestRequest=new A9JSONClient(kw,reqCounter++);
suggestRequest.callSuggestionsService(suggestUrl.join(""));
}function updateCompletion(){if(!suggestRequest){return;
}if(!activityAllowed||!completion.length||!completion[0]||!suggestRequest.keywords||completion[0].toLowerCase()!=suggestRequest.keywords.toLowerCase()){return;
}var c=suggestRequest.counter,m=c===0?metrics.completionsRequest0:(c===metrics.sample?metrics.completionsRequestSample:null);
suggestRequest.cleanup();
suggestRequest=null;
if(!searchBox.hasFocus()){return;
}if(opt.twoPane===1){twoPaneSuggestionsList=build2PaneSuggestions(completion[1],(completion.length>2)?completion[2]:[]);
displayTwoPaneSuggestions(completion[0]);
sugHandler&&sugHandler(completion[0],twoPaneSuggestionsList);
}else{suggestionList=combineSuggestions(completion[1],(completion.length>2)?completion[2]:[]);
displaySuggestions(completion[0]);
sugHandler&&sugHandler(completion[0],suggestionList);
}}function stop(){activityAllowed=false;
requestedKeyword="";
if(suggestRequest){suggestRequest.cleanup();
suggestRequest=null;
}}function start(){activityAllowed=true;
}function encoding(){var encInput=opt.form.find("input[name^='__mk_']");
if(encInput.length){return[encInput.attr("name"),encInput.val()];
}}function blur(){searchBox.blur();
}function focus(){searchBox.focus();
}function offset(){return searchBox.pos();
}function keydown(h){searchBox.keydown(h);
}function checkIAC(){return inlineAutoComplete.touch();
}return{suggest:bindSuggest,keypress:bindKeypress,submit:bindSubmit,blur:blur,keyword:keyword,searchAlias:searchAlias,searchNode:searchNode,stop:stop,start:start,encoding:encoding,focus:focus,offset:offset,keydown:keydown,onFocus:searchBox?searchBox.onFocus:function(){},onBlur:searchBox?searchBox.onBlur:function(){},initStaticSuggestions:initStatic,initDynamicSuggestions:initDynamic,updateAutoCompletion:updateCompletion,init:init};
};
function now(){return(new Date).getTime();
}function nop(){}function suppress(){return false;
}function bzero(len,val){var a=[];
while(len--){a.push(val);
}return a;
}function arrayIndexOf(a,v){for(var i=0,len=a.length;
i<len;
i++){if(a[i]==v){return i;
}}return -1;
}function bold(s){return"<b>"+s+"</b>";
}function input(f,i,n,v,c){f.append($('<input type="hidden"/>').attr(c?"class":"id",i).attr("name",n).attr("value",v));
}function option(v,t){return $("<option/>").attr("value",v).text(t);
}function keyClose(w){return w==13||w==32;
}function findOption(d,v){return d.find('option[value="'+v+'"]');
}function tabIndex(e,i){return e.attr("tabIndex",i).attr("tabindex",i);
}function getShortenedIDForOption(o){var eq;
if(!o||!o.length||(eq=o.indexOf("="))==-1){return"";
}var alias=o.substr(eq+1),dash=alias.indexOf("-")+1,shortID=alias.substr(0,3);
return dash?shortID:(shortID+alias.charAt(dash));
}function changeDropdownSelection(optionValue,selectedDisplayName,highlightOnly,option){var dd=ddBox;
if(optionValue=="search-alias=aps"&&!selectedDisplayName){selectedDisplayName=findOption(dd,optionValue).text();
}$("#"+sdpc).css("visibility","hidden");
$(dcs).text(selectedDisplayName);
dd.val(optionValue);
if(!highlightOnly){opt.sb.focus();
setSearchFormReftag(opt.form,optionValue);
}}function setSearchFormReftag(formElement,optionValue,issMode,sg,numUserChars){var formAction=formElement.attr("action"),isstag=(issMode!=null&&sg),tag=isstag?issMode+"_"+sg.sgIndex+"_"+numUserChars:"dd_"+getShortenedIDForOption(optionValue);
if(isstag||optionValue!=null){if(!refre.test(formAction)){if(formAction.charAt(formAction.length-1)!="/"){formAction+="/";
}formAction+=tag;
}else{if(isstag&&ddaliasre.test(formAction)){formAction=formAction.replace(ddaliasre,"$1_"+tag);
}else{formAction=formAction.replace(refre,"ref=nb_sb_"+tag);
}}formElement.attr("action",formAction);
}}function mergeDropDownEntries(btf){var i=0,dd=ddBox,crt,crtVal,btfVal,btfText,btflen=btf.length,kids=dd.children(),len=kids.length,j=len,vals=[];
while(j-->0){var crt=$(kids[j]).attr("value");
if(crt.match(merchRE)){return;
}vals[j]=crt;
}len=Math.min(len,btflen);
for(j=0;
j<len;
j++){crtVal=vals[j];
if(!i&&crtVal!=btf[0][0]){continue;
}crt=$(kids[j]);
while(i<btflen&&(btfText=btf[i][1])&&crtVal!=(btfVal=btf[i++][0])){option(btfVal,btfText).insertBefore(crt);
}}while(i<btflen&&(btfText=btf[i][1])&&(btfVal=btf[i++][0])){dd.append(option(btfVal,btfText));
}}function A9JSONClient(kw,counter){var fullUrl,noCacheIE,headLoc,scriptId,scriptObj,scriptCounter=counter||0;
function callService(url){fullUrl=url;
noCacheIE="&noCacheIE="+now();
headLoc=document.getElementsByTagName("head").item(0);
scriptId="JscriptId"+scriptCounter;
buildScriptTag();
addScriptTag();
}function buildScriptTag(){scriptObj=document.createElement("script");
scriptObj.setAttribute("type","text/javascript");
scriptObj.setAttribute("charset","utf-8");
scriptObj.setAttribute("src",fullUrl+noCacheIE);
scriptObj.setAttribute("id",scriptId);
}function removeScriptTag(){try{headLoc.removeChild(scriptObj);
}catch(e){}}function addScriptTag(){headLoc.appendChild(scriptObj);
}return{callSuggestionsService:callService,cleanup:removeScriptTag,keywords:kw,counter:scriptCounter};
}function searchDropdown(){var popoverLoaded=false,popoverWidth=410,connElem,popoverTab=$("#searchDropdownContent_tab"),popoverOpen=false;
function initConnDiv(){connElem=$("<div id='"+sdpc+"' class='dropdownConnDiv'></div>");
$("body").append(connElem);
}function createDropdownItem(option,tabIdx){var displayText=option.text(),optionValue=option.attr("value"),selected=option.attr("selected"),current=option.attr("current"),container=$("<label>"),item=$("<div class='searchDropdownOption ap_custom_close'>"+displayText+"</div>").appendTo("body"),clazz="searchDropdownOptionHover";
selected&&item.addClass("selectedDropdownOption");
if(current=="parent"){item.css("font-weight","bold");
}item.hover(function(){item.addClass(clazz);
},function(){item.removeClass(clazz);
}).click(function(){item.removeClass(clazz);
changeDropdownSelection(optionValue,displayText,false,option);
}).keyup(function(e){var w=e.which;
if(w==9){changeDropdownSelection(optionValue,displayText,"true",option);
}else{if(keyClose(w)){item.click();
}}return false;
});
return tabIndex(item,tabIdx);
}function createDropdownContents(){var ddOptions=ddBox.find("option"),numOfOptions=ddOptions.length,curOption=ddOptions.filter("option[current=true]").length,numOfGeneralOptions=curOption?numOfOptions-1:numOfOptions,tableWidthOffset=70,twoColumn;
if(numOfGeneralOptions<14){popoverWidth=popoverTab.width()+28;
tableWidthOffset=tableWidthOffset/2+33;
}else{twoColumn=Math.ceil(numOfGeneralOptions/2);
}var tableWidth=popoverWidth-tableWidthOffset,currentOptionTable=$("<table width='"+tableWidth+"'>"),currentOptionRow=$("<tr/>").appendTo(currentOptionTable),currentOptionSpot=$("<td/>").appendTo(currentOptionRow),id="searchPopoverContents",tableDiv=$("<div id='"+id+"' style='display: none'>").appendTo(currentOptionTable),dropTable=$("<table>").css({width:tableWidth,position:"relative","margin-top":-20}),tabIdx=1,rowArray;
if(twoColumn){rowArray=[];
rowArray.length=twoColumn;
}ddOptions.each(function(i,v){tabIdx++;
var dropRow,t=$(v);
if(t.attr("current")=="true"){var currentOption=createDropdownItem(t,tabIdx).appendTo(currentOptionSpot);
currentOptionTable.addClass("currentDropdownOption");
dropTable.css("margin-top",0);
return true;
}if(twoColumn&&i>=twoColumn){dropRow=rowArray[i-twoColumn];
}else{dropRow=$("<tr>").appendTo(dropTable);
if(twoColumn){rowArray[i]=dropRow;
}}createDropdownItem(t,tabIdx).appendTo($("<td width='50%'>").appendTo(dropRow));
});
dropTable.appendTo(tableDiv.appendTo("body"));
return $("#"+id);
}function updateOptionDisplayName(){var dd=ddBox,ddSelectionName=dd.find("option:selected").text(),displayTab=$(dcs);
if(displayTab.text()!=ddSelectionName){var reverseOption=dd.find('option[text="'+displayTab.text()+'"]');
dd.val(reverseOption.val());
}}function popoverClick(){if(popoverOpen){popoverTab.click();
}}amznJQ.onReady("popover",function(){updateOptionDisplayName();
tabIndex(popoverTab,"0");
popoverTab.keyup(function(e){if(keyClose(e.which)){popoverTab.click();
$("#site-search").submit(suppress);
}return false;
});
var sb=$("#twotabsearchtextbox");
sb.focus(popoverClick).blur(popoverClick);
initConnDiv();
popoverTab.amazonPopoverTrigger({showOnHover:false,showCloseButton:false,forceAlignment:true,localContent:createDropdownContents(),location:"bottom",width:popoverWidth,zIndex:200,skin:"default",locationMargin:4,locationOffset:[1,-2],closeEventInclude:"CLICK_OUTSIDE",onShow:function(popover){tabIndex(popoverTab,"1");
popoverTab.focus();
var pos=popoverTab.offset();
connElem.css({left:pos.left+1,top:pos.top+16,visibility:"visible",width:popoverTab.width()-5});
popoverOpen=true;
$(".ap_content").css("padding",0);
return 1;
},onHide:function(popover){tabIndex(popoverTab,"0");
connElem.css("visibility","hidden");
popoverOpen=false;
return 1;
}});
});
}var btfdd=[["aps","All Departments","137"],["automotive","Automotive","1"],["baby","Baby","3"],["baby-products","Baby","13"],["beauty","Beauty","13"],["stripbooks","Books","137"],["automotive","Car & Motorbike","3"],["wireless-aps","Cell Phones & Service","1"],["classical","Classical Music","37"],["clothing","Clothing","3"],["apparel","Clothing & Accessories","1"],["diy","DIY & Tools","3"],["dvd","DVD","37"],["electronics","Electronics","17"],["electronics","Electronics & Photo","3"],["outdoor","Garden & Outdoors","3"],["grocery","Grocery & Gourmet Food","1"],["drugstore","Health & Beauty","3"],["hpc","Health & Personal Care","1"],["garden","Home & Garden","1"],["kitchen","Home & Garden","7"],["industrial","Industrial & Scientific","1"],["jewelry","Jewellery","3"],["jewelry","Jewelry","1"],["digital-text","Kindle Store","1"],["kitchen","Kitchen & Home","3"],["lighting","Lighting","3"],["magazines","Magazine Subscriptions","1"],["dvd","Movies & TV","1"],["digital-music","MP3 Downloads","13"],["popular","Music","137"],["mi","Musical Instruments","1"],["office-products","Office Products","3"],["office-products","Office Products & Supplies","1"],["shoes","Shoes","1"],["shoes","Shoes & Accessories","3"],["software","Software","137"],["sporting","Sports & Outdoors","1"],["sports","Sports & Leisure","3"],["tools","Tools & Home Improvement","1"],["toys","Toys & Games","3"],["toys-and-games","Toys & Games","1"],["vhs","VHS","137"],["videogames","Video Games","137"],["amazontv","Video On Demand","1"],["watches","Watches","13"]];
window.mergeBTFDropdown=function(){var btf=[],i=0,e,m=issMktid,len=btfdd.length;
for(;
i<len;
i++){e=btfdd[i];
if(e[2].indexOf(m)>=0){btf.push(["search-alias="+e[0],e[1]]);
}}mergeDropDownEntries(btf);
};
window.searchDropdown=searchDropdown;
window.AutoComplete=AC;
if(metrics.isEnabled){uet("cf",metrics.init,{wb:1});
}})(window);
amznJQ.declareAvailable("search-js-autocomplete");
});
});

/* end search-js-autocomplete/autocomplete.js */
